pub trait ChainVm: Vm + Getter + Parser {
    // Required methods
    fn build_block<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Block + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn issue_tx<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Block + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_preference<'life0, 'async_trait>(
        &'life0 self,
        id: Id
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn last_accepted<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Id>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Required Methods§

source

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

Attempt to create a new block from ChainVm data Returns either a block or an error

source

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

Issues a transaction to the chain

source

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

Notify the Vm of the currently preferred block.

source

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

Returns the ID of the last accepted block. If no blocks have been accepted, this should return the genesis block

Implementors§