From c52080dd5c8baf329bbcfc745d83c76b2b80156c Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 24 Dec 2024 13:56:42 +0100 Subject: [PATCH] feat: add BlockConditional (#1846) * feat: add BlockConditional * chore: restructure --- crates/consensus/src/conditional.rs | 13 +++++++++++++ crates/consensus/src/lib.rs | 1 + 2 files changed, 14 insertions(+) create mode 100644 crates/consensus/src/conditional.rs diff --git a/crates/consensus/src/conditional.rs b/crates/consensus/src/conditional.rs new file mode 100644 index 00000000000..90ecd0f96e1 --- /dev/null +++ b/crates/consensus/src/conditional.rs @@ -0,0 +1,13 @@ +//! Helpers for conditional transactions. + +/// Contains attributes of a block that are relevant for block conditional transactions. +/// +/// These attributes are used to determine preconditions for inclusion in the block with the given +/// attributes (EIP-4337 transactions) +#[derive(Debug, Clone, Copy, Default, Eq, PartialEq)] +pub struct BlockConditionalAttributes { + /// The number of the block. + pub number: u64, + /// The block's timestamp + pub timestamp: u64, +} diff --git a/crates/consensus/src/lib.rs b/crates/consensus/src/lib.rs index 90932614ff1..7e71696225c 100644 --- a/crates/consensus/src/lib.rs +++ b/crates/consensus/src/lib.rs @@ -26,6 +26,7 @@ pub use receipt::{ RlpDecodableReceipt, RlpEncodableReceipt, TxReceipt, }; +pub mod conditional; pub mod proofs; pub mod transaction;