pub trait PoolController: Send + Sync {
Show 14 methods
// Required methods
fn add_operations(&mut self, ops: Storage);
fn add_endorsements(&mut self, endorsements: Storage);
fn add_denunciation_precursor(
&self,
denunciation_precursor: DenunciationPrecursor
);
fn notify_final_cs_periods(&mut self, final_cs_periods: &[u64]);
fn get_block_operations(&self, slot: &Slot) -> (Vec<OperationId>, Storage);
fn get_block_endorsements(
&self,
target_block: &BlockId,
slot: &Slot
) -> (Vec<Option<EndorsementId>>, Storage);
fn get_block_denunciations(&self, target_slot: &Slot) -> Vec<Denunciation>;
fn get_endorsement_count(&self) -> usize;
fn get_operation_count(&self) -> usize;
fn contains_endorsements(&self, endorsements: &[EndorsementId]) -> Vec<bool>;
fn contains_operations(&self, operations: &[OperationId]) -> Vec<bool>;
fn get_denunciation_count(&self) -> usize;
fn clone_box(&self) -> Box<dyn PoolController>;
fn get_final_cs_periods(&self) -> Vec<u64>;
}
Expand description
Trait defining a pool controller
Required Methods§
sourcefn add_operations(&mut self, ops: Storage)
fn add_operations(&mut self, ops: Storage)
Asynchronously add operations to pool. Simply print a warning on failure.
sourcefn add_endorsements(&mut self, endorsements: Storage)
fn add_endorsements(&mut self, endorsements: Storage)
Asynchronously add endorsements to pool. Simply print a warning on failure.
sourcefn add_denunciation_precursor(
&self,
denunciation_precursor: DenunciationPrecursor
)
fn add_denunciation_precursor( &self, denunciation_precursor: DenunciationPrecursor )
Add denunciation precursor to pool
sourcefn notify_final_cs_periods(&mut self, final_cs_periods: &[u64])
fn notify_final_cs_periods(&mut self, final_cs_periods: &[u64])
Asynchronously notify of new consensus final periods. Simply print a warning on failure.
sourcefn get_block_operations(&self, slot: &Slot) -> (Vec<OperationId>, Storage)
fn get_block_operations(&self, slot: &Slot) -> (Vec<OperationId>, Storage)
Get operations for block creation.
sourcefn get_block_endorsements(
&self,
target_block: &BlockId,
slot: &Slot
) -> (Vec<Option<EndorsementId>>, Storage)
fn get_block_endorsements( &self, target_block: &BlockId, slot: &Slot ) -> (Vec<Option<EndorsementId>>, Storage)
Get endorsements for a block.
sourcefn get_block_denunciations(&self, target_slot: &Slot) -> Vec<Denunciation>
fn get_block_denunciations(&self, target_slot: &Slot) -> Vec<Denunciation>
Get denunciations for a block header.
sourcefn get_endorsement_count(&self) -> usize
fn get_endorsement_count(&self) -> usize
Get the number of endorsements in the pool
sourcefn get_operation_count(&self) -> usize
fn get_operation_count(&self) -> usize
Get the number of operations in the pool
sourcefn contains_endorsements(&self, endorsements: &[EndorsementId]) -> Vec<bool>
fn contains_endorsements(&self, endorsements: &[EndorsementId]) -> Vec<bool>
Check if the pool contains a list of endorsements. Returns one boolean per item.
sourcefn contains_operations(&self, operations: &[OperationId]) -> Vec<bool>
fn contains_operations(&self, operations: &[OperationId]) -> Vec<bool>
Check if the pool contains a list of operations. Returns one boolean per item.
sourcefn get_denunciation_count(&self) -> usize
fn get_denunciation_count(&self) -> usize
Get the number of denunciations in the pool
sourcefn clone_box(&self) -> Box<dyn PoolController>
fn clone_box(&self) -> Box<dyn PoolController>
Returns a boxed clone of self.
Useful to allow cloning Box<dyn PoolController>
.
sourcefn get_final_cs_periods(&self) -> Vec<u64>
fn get_final_cs_periods(&self) -> Vec<u64>
Get final cs periods (updated regularly from consensus)
Trait Implementations§
source§impl Clone for Box<dyn PoolController>
impl Clone for Box<dyn PoolController>
Allow cloning Box<dyn PoolController>
Uses PoolController::clone_box
internally