pub(crate) fn add(&mut self, signed_vote: &SignedVote, vote_weight: u64) -> BftResult<()> {
        let round = signed_vote.vote.round;

        if self.round_votes.contains_key(&round) {
            self.round_votes
                .get_mut(&round)
                .unwrap()
                .add(signed_vote, vote_weight)
        } else {
            let mut step_votes = StepCollector::new();
            step_votes.add(signed_vote, vote_weight)?;
            self.round_votes.insert(round, step_votes);
            Ok(())
        }
    }
/// A function try to add a vote to a round collector.
A function try to add a vote to a round collector.
A function try to add a vote to a round collector .
pub(crate) fn add(&mut self, signed_vote: &SignedVote, vote_weight: u64) -> BftResult<()> {
        let round = signed_vote.vote.round;
        if self.round_votes.contains_key(&round) {
            self.round_votes
                .get_mut(&round)
                .unwrap()
                .add(signed_vote, vote_weight)
        } else {
            let mut step_votes = StepCollector::new();
            step_votes.add(signed_vote, vote_weight)?;
            self.round_votes.insert(round, step_votes);
            Ok(())
        }
    }
pub ( crate ) fn add ( & mut self , signed_vote : & SignedVote , vote_weight : u64 ) -> BftResult < ( ) > { let round = signed_vote . vote . round ; if self . round_votes . contains_key ( & round ) { self . round_votes . get_mut ( & round ) . unwrap ( ) . add ( signed_vote , vote_weight ) } else { let mut step_votes = StepCollector :: new ( ) ; step_votes . add ( signed_vote , vote_weight ) ? ; self . round_votes . insert ( round , step_votes ) ; Ok ( ( ) ) } }
A function try to add a vote to a round collector.
A function try to add a vote to a round collector .
&mut self
signed_vote
&SignedVote
vote_weight
u64
&mut self
signed_vote
&SignedVote
vote_weight
u64