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