Trait penumbra_sct::component::clock::EpochRead

source ·
pub trait EpochRead: StateRead {
    // Provided methods
    fn get_block_height<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_block_timestamp<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Time>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_current_epoch<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Epoch>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_epoch_by_height<'life0, 'async_trait>(
        &'life0 self,
        height: u64
    ) -> Pin<Box<dyn Future<Output = Result<Epoch>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn is_epoch_ending_early<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Available on crate feature component only.
Expand description

Provides read access to epoch indices, block heights, timestamps, and other related data.

Provided Methods§

source

fn get_block_height<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the current block height.

§Errors

Returns an error if the block height is missing.

source

fn get_block_timestamp<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Time>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Gets the current block timestamp from the JMT

§Errors

Returns an error if the block timestamp is missing.

§Panic

Panics if the block timestamp is not a valid RFC3339 time string.

source

fn get_current_epoch<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Epoch>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the current application epoch.

§Errors

Returns an error if the epoch is missing.

source

fn get_epoch_by_height<'life0, 'async_trait>( &'life0 self, height: u64 ) -> Pin<Box<dyn Future<Output = Result<Epoch>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the epoch corresponding to the supplied height.

§Errors

Returns an error if the epoch is missing.

source

fn is_epoch_ending_early<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Returns true if we are triggering an early epoch end.

Object Safety§

This trait is not object safe.

Implementors§