pub trait StateMachineHandler<BI: BlockchainInterface + 'static>: StateMachine + RoundBlame + Send + Debugwhere
    <Self as StateMachine>::Output: Send,{
    type AdditionalReturnParam: Debug + Send;
    type Return: Debug + Send;

    // Required methods
    fn handle_unsigned_message(
        to_async_proto: &UnboundedSender<Msg<<Self as StateMachine>::MessageBody>>,
        msg: Msg<DKGMessage<Public>>,
        local_ty: &ProtocolType<<BI as BlockchainInterface>::BatchId, <BI as BlockchainInterface>::MaxProposalLength, <BI as BlockchainInterface>::MaxProposalsInBatch, <BI as BlockchainInterface>::Clock>,
        logger: &DebugLogger
    ) -> Result<(), <Self as StateMachine>::Err>;
    fn on_finish<'async_trait>(
        result: <Self as StateMachine>::Output,
        params: AsyncProtocolParameters<BI, MaxAuthorities>,
        additional_param: Self::AdditionalReturnParam
    ) -> Pin<Box<dyn Future<Output = Result<Self::Return, DKGError>> + Send + 'async_trait>>
       where Self: 'async_trait;

    // Provided method
    fn generate_channel(
    ) -> (UnboundedSender<Msg<<Self as StateMachine>::MessageBody>>, UnboundedReceiver<Msg<<Self as StateMachine>::MessageBody>>) { ... }
}
Expand description

Trait for interfacing between the meta handler and the individual state machines

Required Associated Types§

Required Methods§

source

fn handle_unsigned_message( to_async_proto: &UnboundedSender<Msg<<Self as StateMachine>::MessageBody>>, msg: Msg<DKGMessage<Public>>, local_ty: &ProtocolType<<BI as BlockchainInterface>::BatchId, <BI as BlockchainInterface>::MaxProposalLength, <BI as BlockchainInterface>::MaxProposalsInBatch, <BI as BlockchainInterface>::Clock>, logger: &DebugLogger ) -> Result<(), <Self as StateMachine>::Err>

source

fn on_finish<'async_trait>( result: <Self as StateMachine>::Output, params: AsyncProtocolParameters<BI, MaxAuthorities>, additional_param: Self::AdditionalReturnParam ) -> Pin<Box<dyn Future<Output = Result<Self::Return, DKGError>> + Send + 'async_trait>>where Self: 'async_trait,

Provided Methods§

source

fn generate_channel( ) -> (UnboundedSender<Msg<<Self as StateMachine>::MessageBody>>, UnboundedReceiver<Msg<<Self as StateMachine>::MessageBody>>)

Implementations on Foreign Types§

source§

impl<BI: BlockchainInterface + 'static> StateMachineHandler<BI> for Keygen

§

type AdditionalReturnParam = ()

§

type Return = <Keygen as StateMachine>::Output

source§

fn handle_unsigned_message( to_async_proto: &UnboundedSender<Msg<ProtocolMessage>>, msg: Msg<DKGMessage<Public>>, local_ty: &ProtocolType<<BI as BlockchainInterface>::BatchId, <BI as BlockchainInterface>::MaxProposalLength, <BI as BlockchainInterface>::MaxProposalsInBatch, <BI as BlockchainInterface>::Clock>, logger: &DebugLogger ) -> Result<(), <Self as StateMachine>::Err>

source§

fn on_finish<'async_trait>( local_key: <Self as StateMachine>::Output, params: AsyncProtocolParameters<BI, MaxAuthorities>, __arg2: Self::AdditionalReturnParam ) -> Pin<Box<dyn Future<Output = Result<<Self as StateMachine>::Output, DKGError>> + Send + 'async_trait>>where Self: 'async_trait,

source§

impl<BI: BlockchainInterface + 'static> StateMachineHandler<BI> for OfflineStage

§

type AdditionalReturnParam = (StoredUnsignedProposalBatch<<BI as BlockchainInterface>::BatchId, <BI as BlockchainInterface>::MaxProposalLength, <BI as BlockchainInterface>::MaxProposalsInBatch, <BI as BlockchainInterface>::Clock>, OfflinePartyId, u16, BatchKey)

§

type Return = ()

source§

fn handle_unsigned_message( to_async_proto: &UnboundedSender<Msg<OfflineProtocolMessage>>, msg: Msg<DKGMessage<Public>>, local_ty: &ProtocolType<<BI as BlockchainInterface>::BatchId, <BI as BlockchainInterface>::MaxProposalLength, <BI as BlockchainInterface>::MaxProposalsInBatch, <BI as BlockchainInterface>::Clock>, logger: &DebugLogger ) -> Result<(), <Self as StateMachine>::Err>

source§

fn on_finish<'async_trait>( offline_stage: <Self as StateMachine>::Output, params: AsyncProtocolParameters<BI, MaxAuthorities>, unsigned_proposal: Self::AdditionalReturnParam ) -> Pin<Box<dyn Future<Output = Result<(), DKGError>> + Send + 'async_trait>>where Self: 'async_trait,

Implementors§