Refactoring: Unify account_deps and accounts (#17898)
* Changes ThisInvokeContext::get_account() to use accounts instead of pre_accounts. * Adds explicit keys to accounts to make them symmetric to account_deps. * Appends account_deps to accounts in transaction loading and removes account_deps everywhere else.
This commit is contained in:
committed by
GitHub
parent
ffb1f3932a
commit
7462c27d07
@ -3096,15 +3096,21 @@ pub mod rpc_full {
|
||||
accounts.push(if result.is_err() {
|
||||
None
|
||||
} else {
|
||||
transaction
|
||||
.message
|
||||
.account_keys
|
||||
.iter()
|
||||
.position(|pubkey| *pubkey == address)
|
||||
.map(|i| post_simulation_accounts.get(i))
|
||||
.flatten()
|
||||
.map(|account| {
|
||||
UiAccount::encode(&address, account, accounts_encoding, None, None)
|
||||
(0..transaction.message.account_keys.len())
|
||||
.position(|i| {
|
||||
post_simulation_accounts
|
||||
.get(i)
|
||||
.map(|(key, _account)| *key == address)
|
||||
.unwrap_or(false)
|
||||
})
|
||||
.map(|i| {
|
||||
UiAccount::encode(
|
||||
&address,
|
||||
&post_simulation_accounts[i].1,
|
||||
accounts_encoding,
|
||||
None,
|
||||
None,
|
||||
)
|
||||
})
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user