[][src]Function finality_grandpa::validate_commit

pub fn validate_commit<H, N, S, I, C: Chain<H, N>>(
    commit: &Commit<H, N, S, I>,
    voters: &VoterSet<I>,
    chain: &C
) -> Result<CommitValidationResult<H, N>, Error> where
    H: Hash + Clone + Eq + Ord + Debug,
    N: Copy + BlockNumberOps + Debug,
    I: Clone + Hash + Eq + Debug,
    S: Eq

Validates a GRANDPA commit message and returns the ghost calculated using the precommits in the commit message and using the commit target as a base.

Signatures on precommits are assumed to have been checked.

Duplicate votes or votes from voters not in the voter-set will be ignored, but it is recommended for the caller of this function to remove those at signature-verification time.