/// Create new `Voter` tracker with given round number and base block.
///
/// Provide data about the last completed round. If there is no
/// known last completed round, the genesis state (round number 0, no votes, genesis base),
/// should be provided. When available, all messages required to complete
/// the last round should be provided.
///
/// The input stream for commit messages should provide commits which
/// correspond to known blocks only (including all its precommits). It
/// is also responsible for validating the signature data in commit
/// messages.
Create new `Voter` tracker with given round number and base block.
Provide data about the last completed round. If there is no
known last completed round, the genesis state (round number 0, no votes, genesis base),
should be provided. When available, all messages required to complete
the last round should be provided.

The input stream for commit messages should provide commits which
correspond to known blocks only (including all its precommits). It
is also responsible for validating the signature data in commit
messages.
Create new ` Voter ` tracker with given round number and base block . Provide data about the last completed round . If there is no known last completed round the genesis state ( round number 0 no votes genesis base ) should be provided . When available all messages required to complete the last round should be provided . The input stream for commit messages should provide commits which correspond to known blocks only ( including all its precommits ) . It is also responsible for validating the signature data in commit messages .
pub fn new(
		env: Arc<E>,
		voters: VoterSet<E::Id>,
		global_comms: (GlobalIn, GlobalOut),
		last_round_number: u64,
		last_round_votes: Vec<SignedMessage<H, N, E::Signature, E::Id>>,
		last_round_base: (H, N),
		last_finalized: (H, N),
	) -> Self {
		let (finalized_sender, finalized_notifications) = mpsc::unbounded();
		let last_finalized_number = last_finalized.1;
		// re-start the last round and queue all messages to be processed on first poll.
		// keep it in the background so we can push the estimate backwards until finalized
		// by actually waiting for more messages.
		let mut past_rounds = PastRounds::new();
		let mut last_round_state =
			crate::bridge_state::bridge_state(RoundState::genesis(last_round_base.clone())).1;
		if last_round_number > 0 {
			let maybe_completed_last_round = instantiate_last_round(
				voters.clone(),
				last_round_votes,
				last_round_number,
				last_round_base,
				finalized_sender.clone(),
				env.clone(),
			);
			if let Some(mut last_round) = maybe_completed_last_round {
				last_round_state = last_round.bridge_state();
				past_rounds.push(&*env, last_round);
			}
			// when there is no information about the last completed round,
			// the best we can do is assume that the estimate == the given base
			// and that it is finalized. This is always the case for the genesis
			// round of a set.
		}
		let best_round = VotingRound::new(
			last_round_number + 1,
			voters.clone(),
			last_finalized.clone(),
			Some(last_round_state),
			finalized_sender,
			env.clone(),
		);
		let (global_in, global_out) = global_comms;
		let inner = Arc::new(Mutex::new(InnerVoterState { best_round, past_rounds }));
		Voter {
			env,
			voters,
			inner,
			finalized_notifications,
			last_finalized_number,
			last_finalized_in_rounds: last_finalized,
			global_in,
			global_out: Buffered::new(global_out),
		}
	}
pub fn new ( env : Arc < E > , voters : VoterSet < E :: Id > , global_comms : ( GlobalIn , GlobalOut ) , last_round_number : u64 , last_round_votes : Vec < SignedMessage < H , N , E :: Signature , E :: Id > > , last_round_base : ( H , N ) , last_finalized : ( H , N ) , ) -> Self { let ( finalized_sender , finalized_notifications ) = mpsc :: unbounded ( ) ; let last_finalized_number = last_finalized . 1 ; // re-start the last round and queue all messages to be processed on first poll. // keep it in the background so we can push the estimate backwards until finalized // by actually waiting for more messages. let mut past_rounds = PastRounds :: new ( ) ; let mut last_round_state = crate :: bridge_state :: bridge_state ( RoundState :: genesis ( last_round_base . clone ( ) ) ) . 1 ; if last_round_number > 0 { let maybe_completed_last_round = instantiate_last_round ( voters . clone ( ) , last_round_votes , last_round_number , last_round_base , finalized_sender . clone ( ) , env . clone ( ) , ) ; if let Some ( mut last_round ) = maybe_completed_last_round { last_round_state = last_round . bridge_state ( ) ; past_rounds . push ( & * env , last_round ) ; } // when there is no information about the last completed round, // the best we can do is assume that the estimate == the given base // and that it is finalized. This is always the case for the genesis // round of a set. } let best_round = VotingRound :: new ( last_round_number + 1 , voters . clone ( ) , last_finalized . clone ( ) , Some ( last_round_state ) , finalized_sender , env . clone ( ) , ) ; let ( global_in , global_out ) = global_comms ; let inner = Arc :: new ( Mutex :: new ( InnerVoterState { best_round , past_rounds } ) ) ; Voter { env , voters , inner , finalized_notifications , last_finalized_number , last_finalized_in_rounds : last_finalized , global_in , global_out : Buffered :: new ( global_out ) , } }
Create new `Voter` tracker with given round number and base block.
Create new ` Voter ` tracker with given round number and base block .
env
Arc<E>
voters
VoterSet<E::Id>
global_comms
(GlobalIn, GlobalOut)
last_round_number
u64
last_round_votes
Vec<SignedMessage<H, N, E::Signature, E::Id>>
last_round_base
(H, N)
last_finalized
(H, N)