Trait massa_pool_exports::PoolController

source ·
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, timeout: Option<MassaTime>, ) -> Result<(Vec<OperationId>, Storage), PoolError>; fn get_block_endorsements( &self, target_block: &BlockId, slot: &Slot, timeout: Option<MassaTime>, ) -> Result<(Vec<Option<EndorsementId>>, Storage), PoolError>; fn get_block_denunciations( &self, target_slot: &Slot, timeout: Option<MassaTime>, ) -> Result<Vec<Denunciation>, PoolError>; fn get_endorsement_count( &self, timeout: Option<MassaTime>, ) -> Result<usize, PoolError>; fn get_operation_count( &self, timeout: Option<MassaTime>, ) -> Result<usize, PoolError>; fn contains_endorsements( &self, endorsements: &[EndorsementId], timeout: Option<MassaTime>, ) -> Result<Vec<bool>, PoolError>; fn contains_operations( &self, operations: &[OperationId], timeout: Option<MassaTime>, ) -> Result<Vec<bool>, PoolError>; fn get_denunciation_count( &self, timeout: Option<MassaTime>, ) -> Result<usize, PoolError>; 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, timeout: Option<MassaTime>, ) -> Result<(Vec<OperationId>, Storage), PoolError>

Get operations for block creation.

source

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

Get endorsements for a block.

source

fn get_block_denunciations( &self, target_slot: &Slot, timeout: Option<MassaTime>, ) -> Result<Vec<Denunciation>, PoolError>

Get denunciations for a block header.

source

fn get_endorsement_count( &self, timeout: Option<MassaTime>, ) -> Result<usize, PoolError>

Get the number of endorsements in the pool

source

fn get_operation_count( &self, timeout: Option<MassaTime>, ) -> Result<usize, PoolError>

Get the number of operations in the pool

source

fn contains_endorsements( &self, endorsements: &[EndorsementId], timeout: Option<MassaTime>, ) -> Result<Vec<bool>, PoolError>

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

source

fn contains_operations( &self, operations: &[OperationId], timeout: Option<MassaTime>, ) -> Result<Vec<bool>, PoolError>

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

source

fn get_denunciation_count( &self, timeout: Option<MassaTime>, ) -> Result<usize, PoolError>

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§