Skip to content

Commit

Permalink
feat: impl From<RpcBlockHash> for BlockHashOrNumber (#980)
Browse files Browse the repository at this point in the history
feat: impl From<RpcBlockHash> for BlockHashOrNumber
  • Loading branch information
tcoratger authored Jun 26, 2024
1 parent b17baf3 commit 1376683
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/eips/src/eip1898.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ impl From<U64> for BlockHashOrNumber {
}
}

impl From<RpcBlockHash> 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) {
Expand Down

0 comments on commit 1376683

Please sign in to comment.