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