Companion for Substrate #5961 (on_offence weight) (#1103)

* Add new trait to offences

* companion for substrate#6069

* update to latest changes

* Update Cargo.lock

Co-authored-by: André Silva <andre.beat@gmail.com>
Co-authored-by: Gav Wood <gavin@parity.io>
This commit is contained in:
Shawn Tabrizi
2020-05-21 15:32:25 +02:00
committed by GitHub
parent 882b73492d
commit b407af2672
8 changed files with 394 additions and 337 deletions
+6
View File
@@ -56,6 +56,7 @@ use sp_staking::SessionIndex;
use frame_support::{
parameter_types, construct_runtime, debug,
traits::{KeyOwnerProofSystem, SplitTwoWays, Randomness, LockIdentifier},
weights::Weight,
};
use im_online::sr25519::AuthorityId as ImOnlineId;
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
@@ -476,10 +477,15 @@ impl treasury::Trait for Runtime {
type ModuleId = TreasuryModuleId;
}
parameter_types! {
pub const OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get();
}
impl offences::Trait for Runtime {
type Event = Event;
type IdentificationTuple = session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
}
impl authority_discovery::Trait for Runtime {}