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§

source

fn add_operations(&mut self, ops: Storage)

Asynchronously add operations to pool. Simply print a warning on failure.

source

fn add_endorsements(&mut self, endorsements: Storage)

Asynchronously add endorsements to pool. Simply print a warning on failure.

source

fn add_denunciation_precursor( &self, denunciation_precursor: DenunciationPrecursor )

Add denunciation precursor to pool

source

fn notify_final_cs_periods(&mut self, final_cs_periods: &[u64])

Asynchronously notify of new consensus final periods. Simply print a warning on failure.

source

fn get_block_operations(&self, slot: &Slot) -> (Vec<OperationId>, Storage)

Get operations for block creation.

source

fn get_block_endorsements( &self, target_block: &BlockId, slot: &Slot ) -> (Vec<Option<EndorsementId>>, Storage)

Get endorsements for a block.

source

fn get_block_denunciations(&self, target_slot: &Slot) -> Vec<Denunciation>

Get denunciations for a block header.

source

fn get_endorsement_count(&self) -> usize

Get the number of endorsements in the pool

source

fn get_operation_count(&self) -> usize

Get the number of operations in the pool

source

fn contains_endorsements(&self, endorsements: &[EndorsementId]) -> Vec<bool>

Check if the pool contains a list of endorsements. Returns one boolean per item.

source

fn contains_operations(&self, operations: &[OperationId]) -> Vec<bool>

Check if the pool contains a list of operations. Returns one boolean per item.

source

fn get_denunciation_count(&self) -> usize

Get the number of denunciations in the pool

source

fn clone_box(&self) -> Box<dyn PoolController>

Returns a boxed clone of self. Useful to allow cloning Box<dyn PoolController>.

source

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>

Allow cloning Box<dyn PoolController> Uses PoolController::clone_box internally

source§

fn clone(&self) -> Box<dyn PoolController>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§