Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit d12f953

Browse files
committed
store prev header in exec fixture
1 parent 0f9ce85 commit d12f953

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

bin/opt8n/src/cli/t8n.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl<'a> T8n<'a> {
103103
.collect::<Vec<_>>();
104104

105105
// Execute the test block to create the fixture.
106-
let fixture = stf.execute(self.state_cfg.header.clone(), transactions)?;
106+
let fixture = stf.execute(self.state_cfg.pre_header.clone(), self.state_cfg.header.clone(), transactions)?;
107107

108108
// Write the fixture to disk.
109109
let out_path = self

bin/opt8n/src/generator/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ impl StateTransition {
108108

109109
pub(crate) fn execute(
110110
&mut self,
111+
prev_header: Header,
111112
header: Header,
112113
encoded_txs: Vec<Bytes>,
113114
) -> Result<ExecutionFixture> {
@@ -213,7 +214,7 @@ impl StateTransition {
213214
current_coinbase: header.beneficiary,
214215
current_difficulty: header.mix_hash.into(),
215216
current_gas_limit: U256::from(header.gas_limit),
216-
previous_hash: header.parent_hash,
217+
previous_header: prev_header,
217218
current_number: U256::from(header.number),
218219
current_timestamp: U256::from(header.timestamp),
219220
parent_beacon_block_root: header.parent_beacon_block_root,

crates/op-test-vectors/src/execution.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Module containing the execution test fixture.
22
3+
use alloy_consensus::Header;
34
use alloy_genesis::GenesisAccount;
45
use alloy_primitives::{Address, Bloom, Bytes, B256, U256};
56
use serde::{Deserialize, Serialize};
@@ -33,8 +34,8 @@ pub struct ExecutionEnvironment {
3334
pub current_difficulty: U256,
3435
/// The current block gas limit.
3536
pub current_gas_limit: U256,
36-
/// The previous block hash.
37-
pub previous_hash: B256,
37+
/// The previous block header.
38+
pub previous_header: Header,
3839
/// The current block number.
3940
pub current_number: U256,
4041
/// The current block timestamp.
11.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)