mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(rpc-types): from U64 for BlockHashOrNumber and BlockId (#5385)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -410,6 +410,12 @@ impl From<u64> for BlockId {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<U64> for BlockId {
|
||||
fn from(value: U64) -> Self {
|
||||
BlockNumberOrTag::Number(value.to()).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<BlockNumberOrTag> for BlockId {
|
||||
fn from(num: BlockNumberOrTag) -> Self {
|
||||
BlockId::Number(num)
|
||||
@ -622,6 +628,12 @@ impl From<u64> for BlockHashOrNumber {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<U64> for BlockHashOrNumber {
|
||||
fn from(value: U64) -> Self {
|
||||
value.to::<u64>().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) {
|
||||
|
||||
Reference in New Issue
Block a user