// Instantiates the given last round, to be backgrounded until its estimate is finalized.
//
// This round must be completable based on the passed votes (and if not, `None` will be returned),
// but it may be the case that there are some more votes to propagate in order to push
// the estimate backwards and conclude the round (i.e. finalize its estimate).
//
// may only be called with non-zero last round.
Instantiates the given last round, to be backgrounded until its estimate is finalized.
This round must be completable based on the passed votes (and if not, `None` will be returned),
but it may be the case that there are some more votes to propagate in order to push
the estimate backwards and conclude the round .

may only be called with non-zero last round.
Instantiates the given last round to be backgrounded until its estimate is finalized . This round must be completable based on the passed votes ( and if not ` None ` will be returned ) but it may be the case that there are some more votes to propagate in order to push the estimate backwards and conclude the round . may only be called with non - zero last round .
fn instantiate_last_round<H, N, E: Environment<H, N>>(
	voters: VoterSet<E::Id>,
	last_round_votes: Vec<SignedMessage<H, N, E::Signature, E::Id>>,
	last_round_number: u64,
	last_round_base: (H, N),
	finalized_sender: mpsc::UnboundedSender<FinalizedNotification<H, N, E>>,
	env: Arc<E>,
) -> Option<VotingRound<H, N, E>>
where
	H: Clone + Eq + Ord + ::std::fmt::Debug,
	N: Copy + BlockNumberOps + ::std::fmt::Debug,
{
	let last_round_tracker = crate::round::Round::new(crate::round::RoundParams {
		voters,
		base: last_round_base,
		round_number: last_round_number,
	});
	// start as completed so we don't cast votes.
	let mut last_round = VotingRound::completed(last_round_tracker, finalized_sender, None, env);
	for vote in last_round_votes {
		// bail if any votes are bad.
		last_round.handle_vote(vote).ok()?;
	}
	if last_round.round_state().completable {
		Some(last_round)
	} else {
		None
	}
}
fn instantiate_last_round < H , N , E : Environment < H , N > > ( voters : VoterSet < E :: Id > , last_round_votes : Vec < SignedMessage < H , N , E :: Signature , E :: Id > > , last_round_number : u64 , last_round_base : ( H , N ) , finalized_sender : mpsc :: UnboundedSender < FinalizedNotification < H , N , E > > , env : Arc < E > , ) -> Option < VotingRound < H , N , E > > where H : Clone + Eq + Ord + :: std :: fmt :: Debug , N : Copy + BlockNumberOps + :: std :: fmt :: Debug , { let last_round_tracker = crate :: round :: Round :: new ( crate :: round :: RoundParams { voters , base : last_round_base , round_number : last_round_number , } ) ; // start as completed so we don't cast votes. let mut last_round = VotingRound :: completed ( last_round_tracker , finalized_sender , None , env ) ; for vote in last_round_votes { // bail if any votes are bad. last_round . handle_vote ( vote ) . ok ( ) ? ; } if last_round . round_state ( ) . completable { Some ( last_round ) } else { None } }
Instantiates the given last round, to be backgrounded until its estimate is finalized.
Instantiates the given last round to be backgrounded until its estimate is finalized .
voters
VoterSet<E::Id>
last_round_votes
Vec<SignedMessage<H, N, E::Signature, E::Id>>
last_round_number
u64
last_round_base
(H, N)
finalized_sender
mpsc::UnboundedSender<FinalizedNotification<H, N, E>>
env
Arc<E>