/// Handles a Synchronized Binary Value Broadcast step. On output, starts the `Conf` round or
/// decides.
Handles a Synchronized Binary Value Broadcast step. On output, starts the `Conf` round or
decides.
Handles a Synchronized Binary Value Broadcast step . On output starts the ` Conf ` round or decides .
fn handle_sbvb_step(&mut self, sbvb_step: sbv_broadcast::Step<N>) -> Result<Step<N>> {
        let mut step = Step::default();
        let output = step.extend_with(
            sbvb_step,
            |fault| fault,
            |msg| MessageContent::SbvBroadcast(msg).with_epoch(self.epoch),
        );
        if self.conf_values.is_some() {
            return Ok(step); // The `Conf` round has already started.
        }
        if let Some(aux_vals) = output.into_iter().next() {
            // Execute the Coin schedule `false, true, get_coin(), false, true, get_coin(), ...`
            match self.coin_state {
                CoinState::Decided(_) => {
                    self.conf_values = Some(aux_vals);
                    step.extend(self.try_update_epoch()?)
                }
                CoinState::InProgress(_) => {
                    // Start the `Conf` message round.
                    step.extend(self.send_conf(aux_vals)?)
                }
            }
        }
        Ok(step)
    }
fn handle_sbvb_step ( & mut self , sbvb_step : sbv_broadcast :: Step < N > ) -> Result < Step < N > > { let mut step = Step :: default ( ) ; let output = step . extend_with ( sbvb_step , | fault | fault , | msg | MessageContent :: SbvBroadcast ( msg ) . with_epoch ( self . epoch ) , ) ; if self . conf_values . is_some ( ) { return Ok ( step ) ; // The `Conf` round has already started. } if let Some ( aux_vals ) = output . into_iter ( ) . next ( ) { // Execute the Coin schedule `false, true, get_coin(), false, true, get_coin(), ...` match self . coin_state { CoinState :: Decided ( _ ) => { self . conf_values = Some ( aux_vals ) ; step . extend ( self . try_update_epoch ( ) ? ) } CoinState :: InProgress ( _ ) => { // Start the `Conf` message round. step . extend ( self . send_conf ( aux_vals ) ? ) } } } Ok ( step ) }
Handles a Synchronized Binary Value Broadcast step.
Handles a Synchronized Binary Value Broadcast step .
&mut self
sbvb_step
sbv_broadcast::Step<N>