Trait forest_filecoin::message_pool::msgpool::provider::Provider
source · 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§
sourcefn subscribe_head_changes(&self) -> Subscriber<HeadChange>
fn subscribe_head_changes(&self) -> Subscriber<HeadChange>
Update Mpool
’s cur_tipset
whenever there is a change to the provider
sourcefn get_heaviest_tipset(&self) -> Arc<Tipset>
fn get_heaviest_tipset(&self) -> Arc<Tipset>
Get the heaviest Tipset in the provider
sourcefn put_message(&self, msg: &ChainMessage) -> Result<Cid, Error>
fn put_message(&self, msg: &ChainMessage) -> Result<Cid, Error>
Add a message to the MpoolProvider
, return either Cid or Error
depending on successful put
sourcefn get_actor_after(
&self,
addr: &Address,
ts: &Tipset,
) -> Result<ActorState, Error>
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
sourcefn messages_for_block(
&self,
h: &CachingBlockHeader,
) -> Result<(Vec<Message>, Vec<SignedMessage>), Error>
fn messages_for_block( &self, h: &CachingBlockHeader, ) -> Result<(Vec<Message>, Vec<SignedMessage>), Error>
Return the signed messages for given block header
sourcefn load_tipset(&self, tsk: &TipsetKey) -> Result<Arc<Tipset>, Error>
fn load_tipset(&self, tsk: &TipsetKey) -> Result<Arc<Tipset>, Error>
Return a tipset given the tipset keys from the ChainStore
sourcefn chain_compute_base_fee(&self, ts: &Tipset) -> Result<TokenAmount, Error>
fn chain_compute_base_fee(&self, ts: &Tipset) -> Result<TokenAmount, Error>
Computes the base fee