Skip to content

Commit

Permalink
Update simulator accounts after processing transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
00nktk authored and afalaleev committed Oct 8, 2024
1 parent 52174cf commit 89d532a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions evm_loader/lib/src/solana_simulator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl SolanaSimulator {
}

pub fn process_transaction(
&self,
&mut self,
blockhash: Hash,
tx: &SanitizedTransaction,
) -> Result<TransactionSimulationResult, Error> {
Expand Down Expand Up @@ -308,6 +308,16 @@ impl SolanaSimulator {
Some(return_data)
};

if status.is_ok() {
for (pubkey, account) in &accounts {
if solana_sdk::sysvar::instructions::check_id(pubkey) {
continue;
}

self.accounts_db.insert(*pubkey, account.clone());
}
}

Ok(TransactionSimulationResult {
result: status,
logs,
Expand Down Expand Up @@ -483,7 +493,7 @@ impl SolanaSimulator {
}

pub fn simulate_legacy_transaction(
&self,
&mut self,
tx: solana_sdk::transaction::Transaction,
) -> Result<TransactionSimulationResult, Error> {
let versioned_transaction = VersionedTransaction::from(tx);
Expand Down

0 comments on commit 89d532a

Please sign in to comment.