Skip to content

Commit a0813ad

Browse files
committed
chore: delegate rpc header fill to inner consensus header
1 parent f34bbc7 commit a0813ad

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

src/fill/alloy.rs

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ use alloy::{
22
consensus::{Signed, TxType},
33
primitives::U256,
44
};
5-
use revm::{
6-
context::{BlockEnv, TxEnv},
7-
context_interface::block::BlobExcessGasAndPrice,
8-
};
5+
use revm::context::{BlockEnv, TxEnv};
96

107
use crate::{Block, Tx};
118

@@ -315,32 +312,7 @@ impl Block for alloy::consensus::Header {
315312

316313
impl Block for alloy::rpc::types::eth::Header {
317314
fn fill_block_env(&self, block_env: &mut BlockEnv) {
318-
let BlockEnv {
319-
number,
320-
beneficiary,
321-
timestamp,
322-
gas_limit,
323-
basefee,
324-
difficulty,
325-
prevrandao,
326-
blob_excess_gas_and_price,
327-
} = block_env;
328-
*number = U256::from(self.number);
329-
*beneficiary = self.beneficiary;
330-
*timestamp = U256::from(self.timestamp);
331-
*gas_limit = self.gas_limit;
332-
*basefee = self.base_fee_per_gas.unwrap_or_default();
333-
*difficulty = self.difficulty;
334-
*prevrandao = Some(self.mix_hash);
335-
336-
let update_fraction = if self.prague_active() {
337-
revm::primitives::eip4844::BLOB_BASE_FEE_UPDATE_FRACTION_PRAGUE
338-
} else {
339-
revm::primitives::eip4844::BLOB_BASE_FEE_UPDATE_FRACTION_CANCUN
340-
};
341-
342-
*blob_excess_gas_and_price =
343-
self.blob_gas_used.map(|bgu| BlobExcessGasAndPrice::new(bgu, update_fraction));
315+
self.inner.fill_block_env(block_env);
344316
}
345317
}
346318

0 commit comments

Comments
 (0)