diff --git a/crates/rpc/rpc/src/eth/revm_utils.rs b/crates/rpc/rpc/src/eth/revm_utils.rs index 6943c6e28792..2f132fd4dd55 100644 --- a/crates/rpc/rpc/src/eth/revm_utils.rs +++ b/crates/rpc/rpc/src/eth/revm_utils.rs @@ -51,10 +51,32 @@ impl EvmOverrides { Self { state, block: None } } + /// Creates a new instance with the given block overrides. + pub const fn block(block: Option>) -> Self { + Self { state: None, block } + } + /// Returns `true` if the overrides contain state overrides. pub const fn has_state(&self) -> bool { self.state.is_some() } + + /// Returns `true` if the overrides contain block overrides. + pub const fn has_block(&self) -> bool { + self.block.is_some() + } + + /// Adds state overrides to an existing instance. + pub fn with_state(mut self, state: StateOverride) -> Self { + self.state = Some(state); + self + } + + /// Adds block overrides to an existing instance. + pub fn with_block(mut self, block: Box) -> Self { + self.block = Some(block); + self + } } impl From> for EvmOverrides {