Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion crates/statetest-types/src/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ pub struct BlockHeader {
pub requests_hash: Option<B256>,
/// Target blobs per block (EIP-4844 related)
pub target_blobs_per_block: Option<U256>,
/// Slot number (EIP-7843)
pub slot_number: Option<U256>,
}

/// Block structure containing header and transactions
Expand Down Expand Up @@ -346,7 +348,11 @@ impl BlockHeader {
None
},
blob_excess_gas_and_price,
slot_num: 0,
slot_num: self
.slot_number
.unwrap_or_default()
.try_into()
.unwrap_or(u64::MAX),
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions crates/statetest-types/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ pub struct Env {

/// Current block excess blob gas (EIP-4844)
pub current_excess_blob_gas: Option<U256>,

/// Current slot number (EIP-7843)
pub slot_number: Option<U256>,
}
2 changes: 1 addition & 1 deletion crates/statetest-types/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{

/// State test indexed state result deserialization.
#[derive(Debug, PartialEq, Eq, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct Test {
/// Expected exception for this test case, if any.
///
Expand Down
7 changes: 7 additions & 0 deletions crates/statetest-types/src/test_unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ impl TestUnit {
.unwrap_or(u64::MAX),
difficulty: self.env.current_difficulty,
prevrandao: self.env.current_random,
slot_num: self
.env
.slot_number
.unwrap_or_default()
.try_into()
.unwrap_or(u64::MAX),
..BlockEnv::default()
};

Expand Down Expand Up @@ -154,6 +160,7 @@ mod tests {
current_beacon_root: None,
current_withdrawals_root: None,
current_excess_blob_gas: Some(U256::from(excess_blob_gas)),
slot_number: Some(U256::from(1u64)),
},
pre: AddressMap::default(),
post: BTreeMap::default(),
Expand Down
Loading