Skip to content

Commit 3294f3d

Browse files
committed
adds block number to BuiltBlock
1 parent b8251ff commit 3294f3d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

crates/sim/src/built.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ pub struct BuiltBlock {
1919
pub(crate) host_fills: Vec<SignedFill>,
2020
/// Transactions in the block.
2121
pub(crate) transactions: Vec<TxEnvelope>,
22+
/// The block number for the block.
23+
pub(crate) block_number: u64,
2224

2325
/// The amount of gas used by the block so far
2426
pub(crate) gas_used: u64,
@@ -45,12 +47,23 @@ impl BuiltBlock {
4547
Self {
4648
host_fills: Vec::new(),
4749
transactions: Vec::new(),
50+
block_number: 0,
4851
gas_used: 0,
4952
raw_encoding: OnceLock::new(),
5053
hash: OnceLock::new(),
5154
}
5255
}
5356

57+
/// Gets the block number for the block.
58+
pub fn block_number(&self) -> u64 {
59+
self.block_number
60+
}
61+
62+
/// Sets the block number for the block.
63+
pub fn set_block_number(&mut self, block_number: u64) {
64+
self.block_number = block_number;
65+
}
66+
5467
/// Get the amount of gas used by the block.
5568
pub const fn gas_used(&self) -> u64 {
5669
self.gas_used

0 commit comments

Comments
 (0)