Fix account copy step in program test message processor (#16469)
This commit is contained in:
parent
99b3aab703
commit
278c125d99
|
@ -295,13 +295,13 @@ impl solana_sdk::program_stubs::SyscallStubs for SyscallStubs {
|
||||||
.map_err(|err| ProgramError::try_from(err).unwrap_or_else(|err| panic!("{}", err)))?;
|
.map_err(|err| ProgramError::try_from(err).unwrap_or_else(|err| panic!("{}", err)))?;
|
||||||
|
|
||||||
// Copy writeable account modifications back into the caller's AccountInfos
|
// Copy writeable account modifications back into the caller's AccountInfos
|
||||||
for (i, instruction_account) in instruction.accounts.iter().enumerate() {
|
for (i, account_pubkey) in message.account_keys.iter().enumerate() {
|
||||||
if !instruction_account.is_writable {
|
if !message.is_writable(i, true) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
for account_info in account_infos {
|
for account_info in account_infos {
|
||||||
if *account_info.unsigned_key() == instruction_account.pubkey {
|
if account_info.unsigned_key() == account_pubkey {
|
||||||
let account = &accounts[i];
|
let account = &accounts[i];
|
||||||
**account_info.try_borrow_mut_lamports().unwrap() = account.borrow().lamports;
|
**account_info.try_borrow_mut_lamports().unwrap() = account.borrow().lamports;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue