Trait mina_network::processor::TransitionFrontier
source · [−]pub trait TransitionFrontier {
type Block;
fn add_block<'life0, 'async_trait>(
&'life0 mut self,
block: Self::Block
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn set_block_requester(&mut self, sender: Sender<QueryBlockRequest>);
}
Expand description
This struct handles the blocks that are received from the network and has the capability of interacting asynchronously with the networking layer
TODO: Should this below to its own crate?
Required Associated Types
Required Methods
Adds a block that is received from networking layer. The block could be either pushed by other peers or the response of QueryBlockRequest.
sourcefn set_block_requester(&mut self, sender: Sender<QueryBlockRequest>)
fn set_block_requester(&mut self, sender: Sender<QueryBlockRequest>)
Sets the block requester for querying a block, e.g. parent of certain block
The responses will be recieved in a asynchronous way by the add_block
API