Skip to content

Commit ff7b5f7

Browse files
authored
test(spl): modify the test_process_mint_to spec post-condition sequence (#131)
1 parent d433dbf commit ff7b5f7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

program/src/entrypoint-runtime-verification.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2861,15 +2861,20 @@ fn test_process_mint_to(
28612861
} else if dst_initialised.is_err() {
28622862
assert_eq!(result, Err(ProgramError::InvalidAccountData));
28632863
return result;
2864-
} else if !dst_initialised.unwrap() {
2865-
assert_eq!(result, Err(ProgramError::UninitializedAccount));
2866-
return result;
28672864
} else if dst_init_state.unwrap() == AccountState::Frozen { // unwrap must succeed due to dst_initialised not being err
2865+
// The validation sequence is different from p-token
2866+
// P-Token:
2867+
// - !dst_initialised.unwrap()
2868+
// - dst_init_state.unwrap() == AccountState::Frozen
2869+
// - get_account(&accounts[1]).is_native()
28682870
assert_eq!(result, Err(ProgramError::Custom(17)));
28692871
return result;
28702872
} else if get_account(&accounts[1]).is_native() {
28712873
assert_eq!(result, Err(ProgramError::Custom(10)));
28722874
return result;
2875+
} else if !dst_initialised.unwrap() {
2876+
assert_eq!(result, Err(ProgramError::UninitializedAccount));
2877+
return result;
28732878
} else if accounts[0].key != &get_account(&accounts[1]).mint() {
28742879
assert_eq!(result, Err(ProgramError::Custom(3)));
28752880
return result;

0 commit comments

Comments
 (0)