Skip to content

Commit

Permalink
update code_hash query
Browse files Browse the repository at this point in the history
Signed-off-by: smtmfft <[email protected]>
  • Loading branch information
smtmfft committed Dec 26, 2024
1 parent 4ad92f9 commit 4a9b703
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions core/src/preflight/reth_preflight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
interfaces::{RaikoError, RaikoResult},
provider::{db::ProviderDb, BlockDataProvider},
};
use alloy_primitives::{Address, Bytes, B256};
use alloy_primitives::{Bytes, B256};
use alloy_rpc_types::eth::{
Block as AlloyEthBlock, EIP1186AccountProofResponse, Header as AlloyEthHeader,
};
Expand All @@ -31,8 +31,6 @@ pub struct PreFlightRpcData {
pub parent_header: AlloyEthHeader,
/// The account proofs.
pub account_proofs: Vec<EIP1186AccountProofResponse>,
/// The account code bytes.
pub account_codes: HashMap<Address, Bytes>,
/// The parent account proofs.
pub parent_account_proofs: Vec<EIP1186AccountProofResponse>,
/// The contracts used.
Expand Down
4 changes: 2 additions & 2 deletions core/src/provider/preflight_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ impl BlockDataProvider for RethPreflightBlockDataProvider {
let nonce = account_proof.nonce;
let code_hash = account_proof.code_hash;
let code = preflight_data
.account_codes
.get(&account_proof.address)
.contracts
.get(&account_proof.code_hash)
.map(|code| Bytecode::new_raw(code.clone()))
.unwrap();
assert_eq!(code_hash, code.hash_slow());
Expand Down

0 comments on commit 4a9b703

Please sign in to comment.