From 766405d996a7ed6c86b015ca8573919bc70c6812 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Mon, 6 May 2024 16:01:05 -0600 Subject: [PATCH] use default values in lieu of `expect` when finalizing payload --- mev-build-rs/src/payload/builder.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mev-build-rs/src/payload/builder.rs b/mev-build-rs/src/payload/builder.rs index 47f023ee..eac4a1be 100644 --- a/mev-build-rs/src/payload/builder.rs +++ b/mev-build-rs/src/payload/builder.rs @@ -94,11 +94,9 @@ fn append_payment( .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)?;