diff --git a/crates/eips/src/eip1898.rs b/crates/eips/src/eip1898.rs index ca19ef64907..4d1544a0bab 100644 --- a/crates/eips/src/eip1898.rs +++ b/crates/eips/src/eip1898.rs @@ -385,6 +385,17 @@ impl From for BlockId { } } +impl From for BlockId { + fn from(block: BlockHashOrNumber) -> Self { + match block { + BlockHashOrNumber::Hash(hash) => { + Self::Hash(RpcBlockHash { block_hash: hash, require_canonical: None }) + } + BlockHashOrNumber::Number(num) => Self::Number(BlockNumberOrTag::Number(num)), + } + } +} + impl From for BlockId { fn from(block_hash: B256) -> Self { Self::Hash(RpcBlockHash { block_hash, require_canonical: None })