Struct era_test_node::node::BlockContext
source · pub struct BlockContext {
pub batch: u32,
pub miniblock: u64,
pub timestamp: u64,
}Expand description
Keeps track of a block’s batch number, miniblock number and timestamp. Useful for keeping track of the current context when creating multiple blocks.
Fields§
§batch: u32§miniblock: u64§timestamp: u64Implementations§
source§impl BlockContext
impl BlockContext
sourcepub fn from_current(batch: u32, miniblock: u64, timestamp: u64) -> Self
pub fn from_current(batch: u32, miniblock: u64, timestamp: u64) -> Self
Create the current instance that represents the latest block.
sourcepub fn new_batch(&self) -> Self
pub fn new_batch(&self) -> Self
Create the next batch instance that has all parameters incremented by 1.
sourcepub fn new_block(&self) -> BlockContext
pub fn new_block(&self) -> BlockContext
Create the next batch instance that uses the same batch number, and has all other parameters incremented by 1.
Auto Trait Implementations§
impl RefUnwindSafe for BlockContext
impl Send for BlockContext
impl Sync for BlockContext
impl Unpin for BlockContext
impl UnwindSafe for BlockContext
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more