diff --git a/crates/rpc/rpc-types/src/eth/block.rs b/crates/rpc/rpc-types/src/eth/block.rs index c4522c7844b4..985e93e24fcd 100644 --- a/crates/rpc/rpc-types/src/eth/block.rs +++ b/crates/rpc/rpc-types/src/eth/block.rs @@ -410,6 +410,12 @@ impl From for BlockId { } } +impl From for BlockId { + fn from(value: U64) -> Self { + BlockNumberOrTag::Number(value.to()).into() + } +} + impl From for BlockId { fn from(num: BlockNumberOrTag) -> Self { BlockId::Number(num) @@ -622,6 +628,12 @@ impl From for BlockHashOrNumber { } } +impl From for BlockHashOrNumber { + fn from(value: U64) -> Self { + value.to::().into() + } +} + /// Allows for RLP encoding of either a block hash or block number impl Encodable for BlockHashOrNumber { fn encode(&self, out: &mut dyn bytes::BufMut) {