Refactoring: Move KeyedAccounts to InvokeContext (#15410)

Collects all parametric occurrences and the construction of keyed_accounts and puts them into InvokeContext.
This commit is contained in:
Alexander Meißner
2021-04-19 18:48:48 +02:00
committed by GitHub
parent 015bc034a5
commit 9dfcb921cf
27 changed files with 1508 additions and 1408 deletions

View File

@@ -788,7 +788,7 @@ mod tests {
account::AccountSharedData,
account_utils::StateMut,
hash::hash,
keyed_account::{get_signers, next_keyed_account},
keyed_account::{get_signers, keyed_account_at_index},
};
use std::cell::RefCell;
@@ -1715,9 +1715,8 @@ mod tests {
KeyedAccount::new(&authorized_withdrawer_pubkey, true, &withdrawer_account),
];
let signers: HashSet<Pubkey> = get_signers(keyed_accounts);
let keyed_accounts = &mut keyed_accounts.iter();
let vote_keyed_account = next_keyed_account(keyed_accounts).unwrap();
let withdrawer_keyed_account = next_keyed_account(keyed_accounts).unwrap();
let vote_keyed_account = keyed_account_at_index(keyed_accounts, 0).unwrap();
let withdrawer_keyed_account = keyed_account_at_index(keyed_accounts, 1).unwrap();
let res = withdraw(
vote_keyed_account,
lamports,