Skip to content

Commit c755977

Browse files
authored
feat: load account should return db error (#1447)
* feat: load account should return db error * simplify
1 parent 45e3571 commit c755977

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

crates/revm/src/optimism/handler_register.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,30 +240,20 @@ pub fn reward_beneficiary<SPEC: Spec, EXT, DB: Database>(
240240
let l1_cost = l1_block_info.calculate_tx_l1_cost(enveloped_tx, SPEC::SPEC_ID);
241241

242242
// Send the L1 cost of the transaction to the L1 Fee Vault.
243-
let Ok((l1_fee_vault_account, _)) = context
243+
let (l1_fee_vault_account, _) = context
244244
.evm
245245
.inner
246246
.journaled_state
247-
.load_account(optimism::L1_FEE_RECIPIENT, &mut context.evm.inner.db)
248-
else {
249-
return Err(EVMError::Custom(
250-
"[OPTIMISM] Failed to load L1 Fee Vault account.".to_string(),
251-
));
252-
};
247+
.load_account(optimism::L1_FEE_RECIPIENT, &mut context.evm.inner.db)?;
253248
l1_fee_vault_account.mark_touch();
254249
l1_fee_vault_account.info.balance += l1_cost;
255250

256251
// Send the base fee of the transaction to the Base Fee Vault.
257-
let Ok((base_fee_vault_account, _)) = context
252+
let (base_fee_vault_account, _) = context
258253
.evm
259254
.inner
260255
.journaled_state
261-
.load_account(optimism::BASE_FEE_RECIPIENT, &mut context.evm.inner.db)
262-
else {
263-
return Err(EVMError::Custom(
264-
"[OPTIMISM] Failed to load Base Fee Vault account.".to_string(),
265-
));
266-
};
256+
.load_account(optimism::BASE_FEE_RECIPIENT, &mut context.evm.inner.db)?;
267257
base_fee_vault_account.mark_touch();
268258
base_fee_vault_account.info.balance += context
269259
.evm

0 commit comments

Comments
 (0)