Skip to content

Commit

Permalink
Backport #419: add upsert to AccountOverrides (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
segfaultdoc authored Oct 15, 2023
1 parent f85a020 commit 56955bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runtime/src/account_overrides.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ pub struct AccountOverrides {
}

impl AccountOverrides {
pub fn upsert_account_overrides(&mut self, other: AccountOverrides) {
self.accounts.extend(other.accounts);
}

pub fn set_account(&mut self, pubkey: &Pubkey, account: Option<AccountSharedData>) {
match account {
Some(account) => self.accounts.insert(*pubkey, account),
Expand Down

0 comments on commit 56955bf

Please sign in to comment.