Skip to content

Commit 4bef32c

Browse files
authored
BUGFIX: get_account_data_size returning wrong error code (#36)
`get_account_data_size` maps any `Mint` err when loading the account to `Custom(2)`, I missed that and was returning the error prior to mapping incorrectly. [Link to code that does this](https://github.com/runtimeverification/solana-token/blob/77df1eabcf3bcbcc19f123e845ab2c7f53f0d2b6/p-token/src/processor/get_account_data_size.rs#L25C56-L25C94).
1 parent 77df1ea commit 4bef32c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

p-token/src/entrypoint-runtime-verification.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3193,7 +3193,7 @@ fn test_process_get_account_data_size(accounts: &[AccountInfo; 1]) -> ProgramRes
31933193
} else if accounts[0].data_len() != Mint::LEN {
31943194
assert_eq!(result, Err(ProgramError::Custom(2)))
31953195
} else if mint_initialised.is_err() {
3196-
assert_eq!(result, Err(ProgramError::InvalidAccountData))
3196+
assert_eq!(result, Err(ProgramError::Custom(2)))
31973197
} else if !mint_initialised.unwrap() {
31983198
assert_eq!(result, Err(ProgramError::Custom(2)))
31993199
} else {

0 commit comments

Comments
 (0)