From 13766837d4b366675fe400232f9408b3c67c807b Mon Sep 17 00:00:00 2001 From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:52:47 +0200 Subject: [PATCH] feat: impl `From` for `BlockHashOrNumber` (#980) feat: impl From for BlockHashOrNumber --- crates/eips/src/eip1898.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/eips/src/eip1898.rs b/crates/eips/src/eip1898.rs index e73a66138cc..1ff070f2ff3 100644 --- a/crates/eips/src/eip1898.rs +++ b/crates/eips/src/eip1898.rs @@ -658,6 +658,12 @@ impl From for BlockHashOrNumber { } } +impl From for BlockHashOrNumber { + fn from(value: RpcBlockHash) -> Self { + Self::Hash(value.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) {