Share RO and Executable accounts within invocations (#15799)

This commit is contained in:
Jack May
2021-03-10 23:04:00 -08:00
committed by GitHub
parent ac8ccee6b8
commit 478518308d
8 changed files with 145 additions and 85 deletions

View File

@@ -59,7 +59,7 @@ pub trait InvokeContext {
/// Get the bank's active feature set
fn is_feature_active(&self, feature_id: &Pubkey) -> bool;
/// Get an account from a pre-account
fn get_account(&self, pubkey: &Pubkey) -> Option<RefCell<AccountSharedData>>;
fn get_account(&self, pubkey: &Pubkey) -> Option<Rc<RefCell<AccountSharedData>>>;
/// Update timing
fn update_timing(
&mut self,
@@ -333,7 +333,7 @@ impl InvokeContext for MockInvokeContext {
fn is_feature_active(&self, _feature_id: &Pubkey) -> bool {
true
}
fn get_account(&self, _pubkey: &Pubkey) -> Option<RefCell<AccountSharedData>> {
fn get_account(&self, _pubkey: &Pubkey) -> Option<Rc<RefCell<AccountSharedData>>> {
None
}
fn update_timing(