signet_bundle/call/
trevm.rs

1use crate::SignetCallBundle;
2use trevm::{revm::context::BlockEnv, Block};
3
4impl Block for SignetCallBundle {
5    fn fill_block_env(&self, block_env: &mut BlockEnv) {
6        let BlockEnv {
7            number,
8            beneficiary,
9            timestamp,
10            gas_limit,
11            basefee,
12            difficulty,
13            prevrandao: _,
14            blob_excess_gas_and_price: _,
15        } = block_env;
16
17        *number = self.bundle.state_block_number.as_number().unwrap_or(*number);
18        *beneficiary = self.bundle.coinbase.unwrap_or(*beneficiary);
19        *timestamp = self.bundle.timestamp.unwrap_or(*timestamp);
20        *gas_limit = self.bundle.gas_limit.unwrap_or(*gas_limit);
21        *difficulty = self.bundle.difficulty.unwrap_or(*difficulty);
22        *basefee =
23            self.bundle.base_fee.map(|n| n.try_into().unwrap_or(u64::MAX)).unwrap_or(*basefee);
24    }
25}