Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/context/src/journaled_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ impl<DB: Database, ENTRY: JournalEntryTr> Journal<DB, ENTRY> {
self.load_account(*to)?;

// sub balance from
let from_account = &mut self.state.get_mut(from).unwrap();
let from_account = self.state.get_mut(from).unwrap();
Self::touch_account(self.journal.last_mut().unwrap(), from, from_account);
let from_balance = &mut from_account.info.balance;

Expand Down
6 changes: 4 additions & 2 deletions crates/handler/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,12 @@ where
let caller_balance = context
.journal()
.load_account(inputs.caller)?
.map(|a| a.info.balance);
.data
.info
.balance;

// Check if caller has enough balance to send to the created contract.
if caller_balance.data < inputs.value {
if caller_balance < inputs.value {
return return_error(InstructionResult::OutOfFunds);
}

Expand Down
2 changes: 0 additions & 2 deletions crates/optimism/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ where
.enveloped_tx()
.expect("all not deposit tx have enveloped tx")
.clone();
let spec = ctx.cfg().spec();
tx_l1_cost = ctx.chain().calculate_tx_l1_cost(&enveloped_tx, spec);
}

Expand Down Expand Up @@ -178,7 +177,6 @@ where
}

let mut caller_account = ctx.journal().load_account(caller)?;

caller_account.info.balance = caller_account
.info
.balance
Expand Down
Loading