diff --git a/crates/rpc-types/src/eth/block.rs b/crates/rpc-types/src/eth/block.rs index 8135a693e63..648cad252a1 100644 --- a/crates/rpc-types/src/eth/block.rs +++ b/crates/rpc-types/src/eth/block.rs @@ -308,7 +308,9 @@ impl Serialize for BlockNumberOrTag { S: Serializer, { match *self { - BlockNumberOrTag::Number(ref x) => serializer.serialize_str(&format!("0x{x:x}")), + BlockNumberOrTag::Number(ref x) => { + serializer.serialize_str(&format!("0x{:x}", x.to::())) + }, BlockNumberOrTag::Latest => serializer.serialize_str("latest"), BlockNumberOrTag::Finalized => serializer.serialize_str("finalized"), BlockNumberOrTag::Safe => serializer.serialize_str("safe"),