grandpa: store the authority id that is used for voting per round (#7454)

* grandpa: store the authority id that is used for voting per round

* grandpa: fix tests
This commit is contained in:
André Silva
2020-11-05 14:36:35 +00:00
committed by GitHub
parent 6328f8740c
commit 47815a5936
3 changed files with 70 additions and 16 deletions
@@ -252,6 +252,14 @@ impl<H, N> Equivocation<H, N> {
Equivocation::Precommit(ref equivocation) => &equivocation.identity,
}
}
/// Returns the round number when the equivocation happened.
pub fn round_number(&self) -> RoundNumber {
match self {
Equivocation::Prevote(ref equivocation) => equivocation.round_number,
Equivocation::Precommit(ref equivocation) => equivocation.round_number,
}
}
}
/// Verifies the equivocation proof by making sure that both votes target