|
9 | 9 | use std::sync::Arc; |
10 | 10 |
|
11 | 11 | use alloy::{ |
| 12 | + consensus::BlockHeader, |
12 | 13 | eips::BlockId, |
13 | | - network::{AnyNetwork, TransactionBuilder}, |
| 14 | + network::{AnyNetwork, TransactionBuilder, TransactionResponse}, |
14 | 15 | node_bindings::Anvil, |
15 | 16 | primitives::U256, |
16 | 17 | providers::{Provider, ProviderBuilder}, |
17 | 18 | rpc::types::{ |
18 | | - serde_helpers::WithOtherFields, Block, BlockTransactionsKind, Transaction, |
19 | | - TransactionRequest, |
| 19 | + serde_helpers::WithOtherFields, Block, BlockTransactionsKind, TransactionRequest, |
20 | 20 | }, |
21 | 21 | }; |
22 | 22 | use eyre::Result; |
@@ -120,22 +120,22 @@ async fn main() -> Result<()> { |
120 | 120 | Ok(()) |
121 | 121 | } |
122 | 122 |
|
123 | | -fn configure_evm_env( |
124 | | - block: WithOtherFields<Block<WithOtherFields<Transaction>>>, |
| 123 | +fn configure_evm_env<T: TransactionResponse, H: BlockHeader>( |
| 124 | + block: WithOtherFields<Block<T, H>>, |
125 | 125 | shared: SharedBackend, |
126 | 126 | tx_env: TxEnv, |
127 | 127 | ) -> Evm<'static, (), CacheDB<SharedBackend>> { |
128 | | - let basefee = block.header.base_fee_per_gas.map(U256::from).unwrap_or_default(); |
| 128 | + let basefee = block.header.base_fee_per_gas().map(U256::from).unwrap_or_default(); |
129 | 129 | let block_env = BlockEnv { |
130 | | - number: U256::from(block.header.number), |
131 | | - coinbase: block.header.miner, |
132 | | - timestamp: U256::from(block.header.timestamp), |
133 | | - gas_limit: U256::from(block.header.gas_limit), |
| 130 | + number: U256::from(block.header.number()), |
| 131 | + coinbase: block.header.beneficiary(), |
| 132 | + timestamp: U256::from(block.header.timestamp()), |
| 133 | + gas_limit: U256::from(block.header.gas_limit()), |
134 | 134 | basefee, |
135 | | - prevrandao: block.header.mix_hash, |
136 | | - difficulty: block.header.difficulty, |
| 135 | + prevrandao: block.header.mix_hash(), |
| 136 | + difficulty: block.header.difficulty(), |
137 | 137 | blob_excess_gas_and_price: Some(BlobExcessGasAndPrice::new( |
138 | | - block.header.excess_blob_gas.unwrap_or_default(), |
| 138 | + block.header.excess_blob_gas().unwrap_or_default(), |
139 | 139 | )), |
140 | 140 | }; |
141 | 141 |
|
|
0 commit comments