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
@ -64,7 +64,7 @@ pub trait InvokeContext {
|
||||
&mut self,
|
||||
message: &Message,
|
||||
instruction: &CompiledInstruction,
|
||||
accounts: &[Rc<RefCell<AccountSharedData>>],
|
||||
accounts: &[(Pubkey, Rc<RefCell<AccountSharedData>>)],
|
||||
caller_pivileges: Option<&[bool]>,
|
||||
) -> Result<(), InstructionError>;
|
||||
/// Get the program ID of the currently executing program
|
||||
@ -90,7 +90,7 @@ pub trait InvokeContext {
|
||||
fn record_instruction(&self, instruction: &Instruction);
|
||||
/// Get the bank's active feature set
|
||||
fn is_feature_active(&self, feature_id: &Pubkey) -> bool;
|
||||
/// Get an account from a pre-account
|
||||
/// Get an account by its key
|
||||
fn get_account(&self, pubkey: &Pubkey) -> Option<Rc<RefCell<AccountSharedData>>>;
|
||||
/// Update timing
|
||||
fn update_timing(
|
||||
@ -395,7 +395,7 @@ impl<'a> InvokeContext for MockInvokeContext<'a> {
|
||||
&mut self,
|
||||
_message: &Message,
|
||||
_instruction: &CompiledInstruction,
|
||||
_accounts: &[Rc<RefCell<AccountSharedData>>],
|
||||
_accounts: &[(Pubkey, Rc<RefCell<AccountSharedData>>)],
|
||||
_caller_pivileges: Option<&[bool]>,
|
||||
) -> Result<(), InstructionError> {
|
||||
Ok(())
|
||||
|
Reference in New Issue
Block a user