Skip to content

Commit b66f96b

Browse files
authored
Fix Geth header Deserialization (#177)
1 parent caf8060 commit b66f96b

File tree

1 file changed

+5
-5
lines changed
  • modules/consensus/geth-primitives/src

1 file changed

+5
-5
lines changed

modules/consensus/geth-primitives/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use alloy_rlp_derive::{RlpDecodable, RlpEncodable};
77

88
use ethabi::ethereum_types::{Bloom, H160, H256, H64, U256};
99
#[cfg(feature = "std")]
10-
use ethers::types::Block;
10+
use ethers::types::{Block, U64};
1111
use ismp::util::Keccak256;
1212

1313
#[derive(RlpDecodable, RlpEncodable, Debug, Clone)]
@@ -88,12 +88,12 @@ impl From<Block<H256>> for CodecHeader {
8888
withdrawals_hash: block.withdrawals_root,
8989
blob_gas_used: block
9090
.other
91-
.get_deserialized::<u64>("blobGasUsed")
92-
.and_then(|val| val.ok()),
91+
.get_deserialized::<U64>("blobGasUsed")
92+
.and_then(|val| val.ok().map(|val| val.as_u64())),
9393
excess_blob_gas_used: block
9494
.other
95-
.get_deserialized::<u64>("excessBlobGas")
96-
.and_then(|val| val.ok()),
95+
.get_deserialized::<U64>("excessBlobGas")
96+
.and_then(|val| val.ok().map(|val| val.as_u64())),
9797
parent_beacon_root: block
9898
.other
9999
.get_deserialized::<H256>("parentBeaconBlockRoot")

0 commit comments

Comments
 (0)