Skip to content

Commit

Permalink
Aurora runner tracks storage usage to avoid underflow when storage is…
Browse files Browse the repository at this point in the history
… released in future transactions (#85)
  • Loading branch information
birchmd authored May 14, 2021
1 parent 94dc30f commit aaf1ed9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/test_utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl AuroraRunner {
) -> (Option<VMOutcome>, Option<VMError>) {
Self::update_context(&mut self.context, caller_account_id, input);

near_vm_runner::run(
let (maybe_outcome, maybe_error) = near_vm_runner::run(
&self.code,
method_name,
&mut self.ext,
Expand All @@ -138,7 +138,12 @@ impl AuroraRunner {
self.current_protocol_version,
Some(&self.cache),
&self.profile,
)
);

if let Some(outcome) = &maybe_outcome {
self.context.storage_usage = outcome.storage_usage;
}
(maybe_outcome, maybe_error)
}

pub fn create_address(&mut self, address: Address, init_balance: U256, init_nonce: U256) {
Expand Down

0 comments on commit aaf1ed9

Please sign in to comment.