Skip to content

Commit

Permalink
use default values in lieu of expect when finalizing payload
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed May 6, 2024
1 parent 175c4ef commit 766405d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mev-build-rs/src/payload/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,9 @@ fn append_payment<Client: StateProviderFactory>(
.build();

let signer_account = db.load_cache_account(signer.address())?;
// TODO handle option
let nonce = signer_account.account_info().expect("account exists").nonce;
// TODO handle option
let nonce = signer_account.account_info().map(|info| info.nonce).unwrap_or_default();
// SAFETY: cast to bigger type always succeeds
let max_fee_per_gas = block.header().base_fee_per_gas.expect("exists") as u128;
let max_fee_per_gas = block.header().base_fee_per_gas.unwrap_or_default() as u128;
let payment_tx =
make_payment_transaction(signer, config, chain_id, nonce, max_fee_per_gas, value)?;

Expand Down

0 comments on commit 766405d

Please sign in to comment.