babe, grandpa: cleanup stale equivocation reports (#8041)

* grandpa: check equivocation report staleness on `validate_unsigned`

* babe: check equivocation report staleness on `validate_unsigned`

* node: bump spec_version

* babe, grandpa: remove duplicate call destructuring
This commit is contained in:
André Silva
2021-02-04 15:22:11 +00:00
committed by GitHub
parent a32f2b9271
commit 6dea5494f3
5 changed files with 81 additions and 49 deletions
+9
View File
@@ -775,6 +775,15 @@ fn report_equivocation_validate_unsigned_prevents_duplicates() {
.unwrap();
// the report should now be considered stale and the transaction is invalid
// the check for staleness should be done on both `validate_unsigned` and on `pre_dispatch`
assert_err!(
<Grandpa as sp_runtime::traits::ValidateUnsigned>::validate_unsigned(
TransactionSource::Local,
&call,
),
InvalidTransaction::Stale,
);
assert_err!(
<Grandpa as sp_runtime::traits::ValidateUnsigned>::pre_dispatch(&call),
InvalidTransaction::Stale,