pub trait PrimaryCallback<N: Network>: Send + Sync {
// Required methods
fn update_to_next_round(&self, current_round: u64) -> bool;
fn add_new_certificate<'life0, 'async_trait>(
&'life0 self,
certificate: BatchCertificate<N>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
This callback trait allows listening to changes in the Primary, such as round advancement. This is currently used by BFT.
Required Methods§
Sourcefn update_to_next_round(&self, current_round: u64) -> bool
fn update_to_next_round(&self, current_round: u64) -> bool
Notifies that a new round has started.
Sourcefn add_new_certificate<'life0, 'async_trait>(
&'life0 self,
certificate: BatchCertificate<N>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_new_certificate<'life0, 'async_trait>(
&'life0 self,
certificate: BatchCertificate<N>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a new certificate.