alloy_consensus/conditional.rs
1//! Helpers for conditional transactions.
2
3/// Contains attributes of a block that are relevant for block conditional transactions.
4///
5/// These attributes are used to determine preconditions for inclusion in the block with the given
6/// attributes (EIP-4337 transactions)
7#[derive(Debug, Clone, Copy, Default, Eq, PartialEq)]
8pub struct BlockConditionalAttributes {
9 /// The number of the block.
10 pub number: u64,
11 /// The block's timestamp
12 pub timestamp: u64,
13}
14
15impl BlockConditionalAttributes {
16 /// Creates a new `BlockConditionalAttributes` with the given block number and timestamp.
17 pub const fn new(number: u64, timestamp: u64) -> Self {
18 Self { number, timestamp }
19 }
20}