pub trait EpochManager: StateWrite {
// Provided methods
fn put_block_timestamp(&mut self, height: u64, timestamp: Time) { ... }
fn set_end_epoch_flag(&mut self) { ... }
fn put_block_height(&mut self, height: u64) { ... }
fn put_epoch_by_height(&mut self, height: u64, epoch: Epoch) { ... }
}
Available on crate feature
component
only.Expand description
Provides write access to the chain’s epoch manager. The epoch manager is responsible for tracking block and epoch heights as well as related data like reported timestamps and epoch duration.
Provided Methods§
Sourcefn put_block_timestamp(&mut self, height: u64, timestamp: Time)
fn put_block_timestamp(&mut self, height: u64, timestamp: Time)
Writes the current block’s timestamp as an RFC3339 string to verifiable storage.
Also writes the current block’s timestamp to the appropriate key in nonverifiable storage.
Sourcefn set_end_epoch_flag(&mut self)
fn set_end_epoch_flag(&mut self)
Write a value in the end epoch flag in object-storage. This is used to trigger an early epoch end at the end of the block.
Sourcefn put_block_height(&mut self, height: u64)
fn put_block_height(&mut self, height: u64)
Writes the block height to verifiable storage.
Sourcefn put_epoch_by_height(&mut self, height: u64, epoch: Epoch)
fn put_epoch_by_height(&mut self, height: u64, epoch: Epoch)
Index the current epoch by height.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.