diff --git a/crates/eips/src/eip1898.rs b/crates/eips/src/eip1898.rs index df61d1edbee..67d675c9428 100644 --- a/crates/eips/src/eip1898.rs +++ b/crates/eips/src/eip1898.rs @@ -397,7 +397,7 @@ impl From for BlockId { fn from(block: HashOrNumber) -> Self { match block { HashOrNumber::Hash(hash) => { - Self::Hash(RpcBlockHash { block_hash: hash, require_canonical: None }) + RpcBlockHash { block_hash: hash, require_canonical: None }.into() } HashOrNumber::Number(num) => Self::Number(BlockNumberOrTag::Number(num)), } @@ -406,13 +406,19 @@ impl From for BlockId { impl From for BlockId { fn from(block_hash: B256) -> Self { - Self::Hash(RpcBlockHash { block_hash, require_canonical: None }) + RpcBlockHash { block_hash, require_canonical: None }.into() } } impl From<(B256, Option)> for BlockId { fn from(hash_can: (B256, Option)) -> Self { - Self::Hash(RpcBlockHash { block_hash: hash_can.0, require_canonical: hash_can.1 }) + RpcBlockHash { block_hash: hash_can.0, require_canonical: hash_can.1 }.into() + } +} + +impl From for BlockId { + fn from(value: RpcBlockHash) -> Self { + Self::Hash(value) } }