babe, grandpa: set longevity for equivocation report transactions (#8076)

* babe: set longevity for equivocation report transactions

* grandpa: set longevity for equivocation report transaction

* babe, grandpa: fix tests

* node: add ReportLongevity to babe and grandpa modules

* node: bump spec_version
This commit is contained in:
André Silva
2021-02-10 13:51:36 +00:00
committed by GitHub
parent 8481e9a33a
commit c763df4bb1
7 changed files with 70 additions and 23 deletions
+10 -3
View File
@@ -63,8 +63,6 @@ frame_support::construct_runtime!(
parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const EpochDuration: u64 = 3;
pub const ExpectedBlockTime: u64 = 1;
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(16);
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(1024);
@@ -222,6 +220,13 @@ impl pallet_offences::Config for Test {
type WeightSoftLimit = OffencesWeightSoftLimit;
}
parameter_types! {
pub const EpochDuration: u64 = 3;
pub const ExpectedBlockTime: u64 = 1;
pub const ReportLongevity: u64 =
BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get();
}
impl Config for Test {
type EpochDuration = EpochDuration;
type ExpectedBlockTime = ExpectedBlockTime;
@@ -237,7 +242,9 @@ impl Config for Test {
AuthorityId,
)>>::IdentificationTuple;
type HandleEquivocation = super::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
type HandleEquivocation =
super::EquivocationHandler<Self::KeyOwnerIdentification, Offences, ReportLongevity>;
type WeightInfo = ();
}