Skip to content

Commit c52d459

Browse files
authored
BUGFIX: Error with data when retrieving owner (#35)
`Burn{Checked}` instructions call `check_owner`, which will get the `Owner`. This ought to be done from the `AccountInfo` type, instead I was attempting to get it from an `Account` (and also when that `Account` was actually a `Mint`). All access to owner in other functions appears sound.
1 parent f175c61 commit c52d459

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -940,12 +940,12 @@ pub fn test_process_burn(accounts: &[AccountInfo; 3], instruction_data: &[u8; 8]
940940
let src_is_native = get_account(&accounts[0]).is_native();
941941
let src_mint = get_account(&accounts[0]).mint;
942942
let src_owned_sys_inc = get_account(&accounts[0]).is_owned_by_system_program_or_incinerator();
943-
let src_owner = get_account(&accounts[0]).owner;
943+
let src_owner = *accounts[0].owner();
944944
let old_src_delgate = get_account(&accounts[0]).delegate().cloned();
945945
let old_src_delgated_amount = get_account(&accounts[0]).delegated_amount();
946946
let mint_initialised = get_mint(&accounts[1]).is_initialized();
947947
let mint_init_supply = get_mint(&accounts[1]).supply();
948-
let mint_owner = get_account(&accounts[1]).owner;
948+
let mint_owner = *accounts[1].owner();
949949
#[cfg(feature="multisig")]
950950
let multisig_is_initialised = get_multisig(&accounts[2]).is_initialized();
951951

@@ -1515,13 +1515,13 @@ pub fn test_process_burn_checked(accounts: &[AccountInfo; 3], instruction_data:
15151515
let src_is_native = get_account(&accounts[0]).is_native();
15161516
let src_mint = get_account(&accounts[0]).mint;
15171517
let src_owned_sys_inc = get_account(&accounts[0]).is_owned_by_system_program_or_incinerator();
1518-
let src_owner = get_account(&accounts[0]).owner;
1518+
let src_owner = *accounts[0].owner();
15191519
let old_src_delgate = get_account(&accounts[0]).delegate().cloned();
15201520
let old_src_delgated_amount = get_account(&accounts[0]).delegated_amount();
15211521
let mint_initialised = get_mint(&accounts[1]).is_initialized();
15221522
let mint_init_supply = get_mint(&accounts[1]).supply();
15231523
let mint_decimals = get_mint(&accounts[1]).decimals;
1524-
let mint_owner = get_account(&accounts[1]).owner;
1524+
let mint_owner = *accounts[1].owner();
15251525
#[cfg(feature="multisig")]
15261526
let multisig_is_initialised = get_multisig(&accounts[2]).is_initialized();
15271527

0 commit comments

Comments
 (0)