diff --git a/mev-build-rs/src/auctioneer/service.rs b/mev-build-rs/src/auctioneer/service.rs index ae3f1e2d..4e2e074a 100644 --- a/mev-build-rs/src/auctioneer/service.rs +++ b/mev-build-rs/src/auctioneer/service.rs @@ -91,7 +91,7 @@ fn prepare_submission( signature, }) } - other => unreachable!("fork {other} is not reachable from this type"), + fork => return Err(Error::UnsupportedFork(fork)), }; Ok(submission) } diff --git a/mev-build-rs/src/compat.rs b/mev-build-rs/src/compat.rs index fee3aab9..12d6b646 100644 --- a/mev-build-rs/src/compat.rs +++ b/mev-build-rs/src/compat.rs @@ -3,7 +3,7 @@ use ethereum_consensus::{ crypto::{KzgCommitment, KzgProof}, primitives::{Bytes32, ExecutionAddress}, ssz::prelude::{ByteList, ByteVector, SimpleSerializeError, U256}, - Error as ConsensusError, Fork, + Fork, }; use mev_rs::types::{BlobsBundle, ExecutionPayload}; use reth::primitives::{Address, BlobTransactionSidecar, Bloom, SealedBlock, B256}; @@ -106,7 +106,7 @@ pub fn to_execution_payload(value: &SealedBlock, fork: Fork) -> Result Err(Error::Consensus(ConsensusError::UnsupportedFork(fork))), + fork => Err(Error::UnsupportedFork(fork)), } } diff --git a/mev-build-rs/src/error.rs b/mev-build-rs/src/error.rs index d48e323f..7c59ae39 100644 --- a/mev-build-rs/src/error.rs +++ b/mev-build-rs/src/error.rs @@ -1,10 +1,12 @@ use alloy_signer_wallet::WalletError; -use ethereum_consensus::Error as ConsensusError; +use ethereum_consensus::{Error as ConsensusError, Fork}; use reth::payload::error::PayloadBuilderError; use thiserror::Error; #[derive(Error, Debug)] pub enum Error { + #[error("fork {0} is not supported for this operation")] + UnsupportedFork(Fork), #[error(transparent)] Consensus(#[from] ConsensusError), #[error(transparent)]