fn coin_state(&self) -> Result<CoinState<N>> {
        match self.epoch % 3 {
            0 => Ok(CoinState::Decided(true)),
            1 => Ok(CoinState::Decided(false)),
            _ => {
                let coin_id = bincode::serialize(&(&self.session_id, self.epoch))?;
                let mut ts = ThresholdSign::new(self.netinfo.clone());
                ts.set_document(coin_id).map_err(Error::InvokeCoin)?;
                Ok(CoinState::InProgress(Box::new(ts)))
            }
        }
    }
/// Creates the initial coin state for the current epoch, i.e. sets it to the predetermined
/// value, or initializes a `ThresholdSign` instance.
Creates the initial coin state for the current epoch, i.e. sets it to the predetermined
value, or initializes a `ThresholdSign` instance.
Creates the initial coin state for the current epoch i . e . sets it to the predetermined value or initializes a ` ThresholdSign ` instance .
fn coin_state(&self) -> Result<CoinState<N>> {
        match self.epoch % 3 {
            0 => Ok(CoinState::Decided(true)),
            1 => Ok(CoinState::Decided(false)),
            _ => {
                let coin_id = bincode::serialize(&(&self.session_id, self.epoch))?;
                let mut ts = ThresholdSign::new(self.netinfo.clone());
                ts.set_document(coin_id).map_err(Error::InvokeCoin)?;
                Ok(CoinState::InProgress(Box::new(ts)))
            }
        }
    }
fn coin_state ( & self ) -> Result < CoinState < N > > { match self . epoch % 3 { 0 => Ok ( CoinState :: Decided ( true ) ) , 1 => Ok ( CoinState :: Decided ( false ) ) , _ => { let coin_id = bincode :: serialize ( & ( & self . session_id , self . epoch ) ) ? ; let mut ts = ThresholdSign :: new ( self . netinfo . clone ( ) ) ; ts . set_document ( coin_id ) . map_err ( Error :: InvokeCoin ) ? ; Ok ( CoinState :: InProgress ( Box :: new ( ts ) ) ) } } }
Creates the initial coin state for the current epoch, i.e.
Creates the initial coin state for the current epoch i . e .
&self
&self