pub fn check_vote<B: Block>(
	authorities: &[AuthorityId],
	parent_hash: &B::Hash,
	vote: &rhododendron::LocalizedVote<B::Hash, AuthorityId, LocalizedSignature>)
	-> Result<(), Error>
{
	if !authorities.contains(&vote.sender) {
		return Err(CommonErrorKind::InvalidAuthority(vote.sender.into()).into());
	}

	let action = match vote.vote {
		rhododendron::Vote::Prepare(r, ref h) => Action::Prepare(r as u32, h.clone()),
		rhododendron::Vote::Commit(r, ref h) => Action::Commit(r as u32, h.clone()),
		rhododendron::Vote::AdvanceRound(r) => Action::AdvanceRound(r as u32),
	};
	check_action::<B>(action, parent_hash, &vote.signature)
}
/// Check vote message signatures and authority.
/// Provide all valid authorities.
Check vote message signatures and authority.
Provide all valid authorities.
Check vote message signatures and authority . Provide all valid authorities .
pub fn check_vote<B: Block>(
	authorities: &[AuthorityId],
	parent_hash: &B::Hash,
	vote: &rhododendron::LocalizedVote<B::Hash, AuthorityId, LocalizedSignature>)
	-> Result<(), Error>
{
	if !authorities.contains(&vote.sender) {
		return Err(CommonErrorKind::InvalidAuthority(vote.sender.into()).into());
	}
	let action = match vote.vote {
		rhododendron::Vote::Prepare(r, ref h) => Action::Prepare(r as u32, h.clone()),
		rhododendron::Vote::Commit(r, ref h) => Action::Commit(r as u32, h.clone()),
		rhododendron::Vote::AdvanceRound(r) => Action::AdvanceRound(r as u32),
	};
	check_action::<B>(action, parent_hash, &vote.signature)
}
pub fn check_vote < B : Block > ( authorities : & [ AuthorityId ] , parent_hash : & B :: Hash , vote : & rhododendron :: LocalizedVote < B :: Hash , AuthorityId , LocalizedSignature > ) -> Result < ( ) , Error > { if ! authorities . contains ( & vote . sender ) { return Err ( CommonErrorKind :: InvalidAuthority ( vote . sender . into ( ) ) . into ( ) ) ; } let action = match vote . vote { rhododendron :: Vote :: Prepare ( r , ref h ) => Action :: Prepare ( r as u32 , h . clone ( ) ) , rhododendron :: Vote :: Commit ( r , ref h ) => Action :: Commit ( r as u32 , h . clone ( ) ) , rhododendron :: Vote :: AdvanceRound ( r ) => Action :: AdvanceRound ( r as u32 ) , } ; check_action :: < B > ( action , parent_hash , & vote . signature ) }
Check vote message signatures and authority.
Check vote message signatures and authority .
authorities
&[AuthorityId]
parent_hash
&B::Hash
vote
&rhododendron::LocalizedVote<B::Hash, AuthorityId, LocalizedSignature>
authorities
&[AuthorityId]
parent_hash
&B::Hash
vote
&rhododendron::LocalizedVote<B::Hash, AuthorityId, LocalizedSignature>