use Account for test since it borrows mut ref to data (#15852)

This commit is contained in:
Jeff Washington (jwash) 2021-03-15 21:56:48 -05:00 committed by GitHub
parent e35d738906
commit e50f284658
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -111,9 +111,14 @@ pub fn builtin_process_instruction(
set_invoke_context(invoke_context);
// Copy all the accounts into a HashMap to ensure there are no duplicates
let mut accounts: HashMap<Pubkey, AccountSharedData> = keyed_accounts
let mut accounts: HashMap<Pubkey, Account> = keyed_accounts
.iter()
.map(|ka| (*ka.unsigned_key(), ka.account.borrow().clone()))
.map(|ka| {
(
*ka.unsigned_key(),
Account::from(ka.account.borrow().clone()),
)
})
.collect();
// Create shared references to each account's lamports/data/owner