From e50f284658b49d561261f2a7063b5bfa3f2dcb4a Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Mon, 15 Mar 2021 21:56:48 -0500 Subject: [PATCH] use Account for test since it borrows mut ref to data (#15852) --- program-test/src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/program-test/src/lib.rs b/program-test/src/lib.rs index 50126947d..53520c13a 100644 --- a/program-test/src/lib.rs +++ b/program-test/src/lib.rs @@ -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 = keyed_accounts + let mut accounts: HashMap = 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