Add WeightInfo to all pallets with benchmarks. (#6575)

* Start adding weight info

* More weightinfo

* finish weight info

* more fixes

* inital update of node runtime

* fix the rest of the compilation

* update balances

* add docs

* fix balances tests

* Fix more tests

* Fix compile

* Fix pallet-evm tests
This commit is contained in:
Shawn Tabrizi
2020-07-08 18:22:01 +02:00
committed by GitHub
parent 94cddee160
commit 2302898b8a
65 changed files with 632 additions and 7 deletions
+19
View File
@@ -171,11 +171,13 @@ impl frame_system::Trait for Runtime {
type AccountData = pallet_balances::AccountData<Balance>;
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
}
impl pallet_utility::Trait for Runtime {
type Event = Event;
type Call = Call;
type WeightInfo = ();
}
parameter_types! {
@@ -193,6 +195,7 @@ impl pallet_multisig::Trait for Runtime {
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
type WeightInfo = ();
}
parameter_types! {
@@ -246,6 +249,7 @@ impl pallet_proxy::Trait for Runtime {
type ProxyDepositBase = ProxyDepositBase;
type ProxyDepositFactor = ProxyDepositFactor;
type MaxProxies = MaxProxies;
type WeightInfo = ();
}
parameter_types! {
@@ -259,6 +263,7 @@ impl pallet_scheduler::Trait for Runtime {
type Call = Call;
type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
}
parameter_types! {
@@ -296,6 +301,7 @@ impl pallet_indices::Trait for Runtime {
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type WeightInfo = ();
}
parameter_types! {
@@ -308,6 +314,7 @@ impl pallet_balances::Trait for Runtime {
type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = frame_system::Module<Runtime>;
type WeightInfo = ();
}
parameter_types! {
@@ -334,6 +341,7 @@ impl pallet_timestamp::Trait for Runtime {
type Moment = Moment;
type OnTimestampSet = Babe;
type MinimumPeriod = MinimumPeriod;
type WeightInfo = ();
}
parameter_types! {
@@ -370,6 +378,7 @@ impl pallet_session::Trait for Runtime {
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
type WeightInfo = ();
}
impl pallet_session::historical::Trait for Runtime {
@@ -426,6 +435,7 @@ impl pallet_staking::Trait for Runtime {
type MinSolutionScoreBump = MinSolutionScoreBump;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type UnsignedPriority = StakingUnsignedPriority;
type WeightInfo = ();
}
parameter_types! {
@@ -474,6 +484,7 @@ impl pallet_democracy::Trait for Runtime {
type Scheduler = Scheduler;
type PalletsOrigin = OriginCaller;
type MaxVotes = MaxVotes;
type WeightInfo = ();
}
parameter_types! {
@@ -488,6 +499,7 @@ impl pallet_collective::Trait<CouncilCollective> for Runtime {
type Event = Event;
type MotionDuration = CouncilMotionDuration;
type MaxProposals = CouncilMaxProposals;
type WeightInfo = ();
}
parameter_types! {
@@ -519,6 +531,7 @@ impl pallet_elections_phragmen::Trait for Runtime {
type DesiredMembers = DesiredMembers;
type DesiredRunnersUp = DesiredRunnersUp;
type TermDuration = TermDuration;
type WeightInfo = ();
}
parameter_types! {
@@ -533,6 +546,7 @@ impl pallet_collective::Trait<TechnicalCollective> for Runtime {
type Event = Event;
type MotionDuration = TechnicalMotionDuration;
type MaxProposals = TechnicalMaxProposals;
type WeightInfo = ();
}
type EnsureRootOrHalfCouncil = EnsureOneOf<
@@ -587,6 +601,7 @@ impl pallet_treasury::Trait for Runtime {
type ProposalBondMinimum = ProposalBondMinimum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type WeightInfo = ();
}
parameter_types! {
@@ -688,6 +703,7 @@ impl pallet_im_online::Trait for Runtime {
type SessionDuration = SessionDuration;
type ReportUnresponsiveness = Offences;
type UnsignedPriority = ImOnlineUnsignedPriority;
type WeightInfo = ();
}
parameter_types! {
@@ -699,6 +715,7 @@ impl pallet_offences::Trait for Runtime {
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
type WeightInfo = ();
}
impl pallet_authority_discovery::Trait for Runtime {}
@@ -757,6 +774,7 @@ impl pallet_identity::Trait for Runtime {
type Slashed = Treasury;
type ForceOrigin = EnsureRootOrHalfCouncil;
type RegistrarOrigin = EnsureRootOrHalfCouncil;
type WeightInfo = ();
}
parameter_types! {
@@ -813,6 +831,7 @@ impl pallet_vesting::Trait for Runtime {
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = ();
}
construct_runtime!(