pub trait Provider {
    // Required methods
    fn subscribe_head_changes(&self) -> Subscriber<HeadChange>;
    fn get_heaviest_tipset(&self) -> Arc<Tipset>;
    fn put_message(&self, msg: &ChainMessage) -> Result<Cid, Error>;
    fn get_actor_after(
        &self,
        addr: &Address,
        ts: &Tipset,
    ) -> Result<ActorState, Error>;
    fn messages_for_block(
        &self,
        h: &CachingBlockHeader,
    ) -> Result<(Vec<Message>, Vec<SignedMessage>), Error>;
    fn load_tipset(&self, tsk: &TipsetKey) -> Result<Arc<Tipset>, Error>;
    fn chain_compute_base_fee(&self, ts: &Tipset) -> Result<TokenAmount, Error>;

    // Provided methods
    fn max_actor_pending_messages(&self) -> u64 { ... }
    fn max_untrusted_actor_pending_messages(&self) -> u64 { ... }
}
Expand description

Provider Trait. This trait will be used by the message pool to interact with some medium in order to do the operations that are listed below that are required for the message pool.

Required Methods§

source

fn subscribe_head_changes(&self) -> Subscriber<HeadChange>

Update Mpool’s cur_tipset whenever there is a change to the provider

source

fn get_heaviest_tipset(&self) -> Arc<Tipset>

Get the heaviest Tipset in the provider

source

fn put_message(&self, msg: &ChainMessage) -> Result<Cid, Error>

Add a message to the MpoolProvider, return either Cid or Error depending on successful put

source

fn get_actor_after( &self, addr: &Address, ts: &Tipset, ) -> Result<ActorState, Error>

Return state actor for given address given the tipset that the a temp StateTree will be rooted at. Return ActorState or Error depending on whether or not ActorState is found

source

fn messages_for_block( &self, h: &CachingBlockHeader, ) -> Result<(Vec<Message>, Vec<SignedMessage>), Error>

Return the signed messages for given block header

source

fn load_tipset(&self, tsk: &TipsetKey) -> Result<Arc<Tipset>, Error>

Return a tipset given the tipset keys from the ChainStore

source

fn chain_compute_base_fee(&self, ts: &Tipset) -> Result<TokenAmount, Error>

Computes the base fee

Provided Methods§

Implementors§

source§

impl<DB> Provider for MpoolRpcProvider<DB>
where DB: Blockstore + Sync + Send + 'static,