Unverified Commit e3d83c1d authored by Shawn Tabrizi's avatar Shawn Tabrizi Committed by GitHub
Browse files

Companion for #6575 (Add `WeightInfo`) (#1352)

* Add `WeightInfo`

* fix test

* fix tests

* fix more tests
parent 9cc8c576
Pipeline #99827 failed with stages
in 5 minutes and 18 seconds
......@@ -690,6 +690,7 @@ mod tests {
type AccountData = balances::AccountData<u64>;
type OnNewAccount = ();
type OnKilledAccount = Balances;
type SystemWeightInfo = ();
}
parameter_types! {
......@@ -704,6 +705,7 @@ mod tests {
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
}
impl vesting::Trait for Test {
......@@ -711,6 +713,7 @@ mod tests {
type Currency = Balances;
type BlockNumberToBalance = Identity;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = ();
}
parameter_types!{
......
......@@ -617,6 +617,7 @@ mod tests {
type AccountData = balances::AccountData<u64>;
type OnNewAccount = ();
type OnKilledAccount = Balances;
type SystemWeightInfo = ();
}
parameter_types! {
pub const ExistentialDeposit: u64 = 1;
......@@ -627,6 +628,7 @@ mod tests {
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
}
parameter_types! {
......@@ -667,6 +669,7 @@ mod tests {
type TipReportDepositBase = TipReportDepositBase;
type TipReportDepositPerByte = TipReportDepositPerByte;
type ModuleId = TreasuryModuleId;
type WeightInfo = ();
}
thread_local! {
......
......@@ -141,6 +141,7 @@ mod multiplier_tests {
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
}
type System = system::Module<Runtime>;
......
......@@ -1760,6 +1760,7 @@ mod tests {
type AccountData = balances::AccountData<u128>;
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
}
impl<C> system::offchain::SendTransactionTypes<C> for Test where
......@@ -1799,6 +1800,7 @@ mod tests {
type SessionHandler = TestSessionHandler;
type Keys = TestSessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
type WeightInfo = ();
}
impl session::historical::Trait for Test {
......@@ -1813,6 +1815,7 @@ mod tests {
type Moment = u64;
type OnTimestampSet = ();
type MinimumPeriod = MinimumPeriod;
type WeightInfo = ();
}
mod time {
......@@ -1860,6 +1863,7 @@ mod tests {
type Event = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
}
pallet_staking_reward_curve::build! {
......@@ -1915,6 +1919,7 @@ mod tests {
type UnsignedPriority = StakingUnsignedPriority;
type MaxIterations = ();
type MinSolutionScoreBump = ();
type WeightInfo = ();
}
impl attestations::Trait for Test {
......@@ -1962,6 +1967,7 @@ mod tests {
type IdentificationTuple = session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
type WeightInfo = ();
}
parameter_types! {
......
......@@ -747,6 +747,7 @@ mod tests {
type AccountData = balances::AccountData<u128>;
type OnNewAccount = ();
type OnKilledAccount = Balances;
type SystemWeightInfo = ();
}
impl<C> system::offchain::SendTransactionTypes<C> for Test where
......@@ -766,6 +767,7 @@ mod tests {
type Event = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
}
parameter_types!{
......@@ -814,6 +816,7 @@ mod tests {
type ValidatorId = u64;
type ValidatorIdOf = ();
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
type WeightInfo = ();
}
parameter_types! {
......@@ -848,12 +851,14 @@ mod tests {
type UnsignedPriority = StakingUnsignedPriority;
type MaxIterations = ();
type MinSolutionScoreBump = ();
type WeightInfo = ();
}
impl timestamp::Trait for Test {
type Moment = u64;
type OnTimestampSet = ();
type MinimumPeriod = MinimumPeriod;
type WeightInfo = ();
}
impl session::historical::Trait for Test {
......
......@@ -933,6 +933,7 @@ mod tests {
type AccountData = balances::AccountData<u64>;
type OnNewAccount = ();
type OnKilledAccount = Balances;
type SystemWeightInfo = ();
}
parameter_types! {
......@@ -945,6 +946,7 @@ mod tests {
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
}
thread_local! {
......
......@@ -147,6 +147,7 @@ impl system::Trait for Runtime {
type AccountData = balances::AccountData<Balance>;
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
}
impl scheduler::Trait for Runtime {
......@@ -156,6 +157,7 @@ impl scheduler::Trait for Runtime {
type Call = Call;
type MaximumWeight = MaximumBlockWeight;
type ScheduleOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
}
parameter_types! {
......@@ -195,6 +197,7 @@ impl indices::Trait for Runtime {
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type WeightInfo = ();
}
parameter_types! {
......@@ -215,6 +218,7 @@ impl balances::Trait for Runtime {
type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
}
parameter_types! {
......@@ -236,6 +240,7 @@ impl timestamp::Trait for Runtime {
type Moment = u64;
type OnTimestampSet = Babe;
type MinimumPeriod = MinimumPeriod;
type WeightInfo = ();
}
parameter_types! {
......@@ -279,6 +284,7 @@ impl session::Trait for Runtime {
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
type WeightInfo = ();
}
impl session::historical::Trait for Runtime {
......@@ -345,6 +351,7 @@ impl staking::Trait for Runtime {
type UnsignedPriority = StakingUnsignedPriority;
type MaxIterations = MaxIterations;
type MinSolutionScoreBump = MinSolutionScoreBump;
type WeightInfo = ();
}
parameter_types! {
......@@ -393,6 +400,7 @@ impl democracy::Trait for Runtime {
type PalletsOrigin = OriginCaller;
type MaxVotes = MaxVotes;
type OperationalPreimageOrigin = collective::EnsureMember<AccountId, CouncilCollective>;
type WeightInfo = ();
}
parameter_types! {
......@@ -407,6 +415,7 @@ impl collective::Trait<CouncilCollective> for Runtime {
type Event = Event;
type MotionDuration = CouncilMotionDuration;
type MaxProposals = CouncilMaxProposals;
type WeightInfo = ();
}
parameter_types! {
......@@ -436,6 +445,7 @@ impl elections_phragmen::Trait for Runtime {
type DesiredRunnersUp = DesiredRunnersUp;
type TermDuration = TermDuration;
type ModuleId = ElectionsPhragmenModuleId;
type WeightInfo = ();
}
parameter_types! {
......@@ -450,6 +460,7 @@ impl collective::Trait<TechnicalCollective> for Runtime {
type Event = Event;
type MotionDuration = TechnicalMotionDuration;
type MaxProposals = TechnicalMaxProposals;
type WeightInfo = ();
}
impl membership::Trait<membership::Instance1> for Runtime {
......@@ -498,6 +509,7 @@ impl treasury::Trait for Runtime {
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type ModuleId = TreasuryModuleId;
type WeightInfo = ();
}
parameter_types! {
......@@ -509,6 +521,7 @@ impl offences::Trait for Runtime {
type IdentificationTuple = session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
type WeightInfo = ();
}
impl authority_discovery::Trait for Runtime {}
......@@ -528,6 +541,7 @@ impl im_online::Trait for Runtime {
type ReportUnresponsiveness = Offences;
type SessionDuration = SessionDuration;
type UnsignedPriority = ImOnlineUnsignedPriority;
type WeightInfo = ();
}
impl grandpa::Trait for Runtime {
......@@ -725,11 +739,13 @@ impl identity::Trait for Runtime {
type MaxRegistrars = MaxRegistrars;
type RegistrarOrigin = MoreThanHalfCouncil;
type ForceOrigin = MoreThanHalfCouncil;
type WeightInfo = ();
}
impl utility::Trait for Runtime {
type Event = Event;
type Call = Call;
type WeightInfo = ();
}
parameter_types! {
......@@ -747,6 +763,7 @@ impl multisig::Trait for Runtime {
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
type WeightInfo = ();
}
parameter_types! {
......@@ -803,6 +820,7 @@ impl vesting::Trait for Runtime {
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = ();
}
parameter_types! {
......@@ -904,6 +922,7 @@ impl proxy::Trait for Runtime {
type ProxyDepositBase = ProxyDepositBase;
type ProxyDepositFactor = ProxyDepositFactor;
type MaxProxies = MaxProxies;
type WeightInfo = ();
}
pub struct CustomOnRuntimeUpgrade;
......
......@@ -87,6 +87,7 @@ impl system::Trait for Test {
type AccountData = balances::AccountData<u128>;
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
}
impl crate::initializer::Trait for Test {
......
......@@ -178,6 +178,7 @@ impl system::Trait for Runtime {
type AccountData = balances::AccountData<Balance>;
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
}
impl scheduler::Trait for Runtime {
......@@ -187,6 +188,7 @@ impl scheduler::Trait for Runtime {
type Call = Call;
type MaximumWeight = MaximumBlockWeight;
type ScheduleOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
}
parameter_types! {
......@@ -226,6 +228,7 @@ impl indices::Trait for Runtime {
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type WeightInfo = ();
}
parameter_types! {
......@@ -246,13 +249,13 @@ impl balances::Trait for Runtime {
type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
}
parameter_types! {
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
}
impl transaction_payment::Trait for Runtime {
type Currency = Balances;
type OnTransactionPayment = DealWithFees;
......@@ -268,6 +271,7 @@ impl timestamp::Trait for Runtime {
type Moment = u64;
type OnTimestampSet = Babe;
type MinimumPeriod = MinimumPeriod;
type WeightInfo = ();
}
parameter_types! {
......@@ -306,6 +310,7 @@ impl session::Trait for Runtime {
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
type WeightInfo = ();
}
impl session::historical::Trait for Runtime {
......@@ -371,6 +376,7 @@ impl staking::Trait for Runtime {
type UnsignedPriority = StakingUnsignedPriority;
type MaxIterations = MaxIterations;
type MinSolutionScoreBump = MinSolutionScoreBump;
type WeightInfo = ();
}
parameter_types! {
......@@ -395,6 +401,7 @@ impl identity::Trait for Runtime {
type Slashed = Treasury;
type ForceOrigin = MoreThanHalfCouncil;
type RegistrarOrigin = MoreThanHalfCouncil;
type WeightInfo = ();
}
parameter_types! {
......@@ -461,6 +468,7 @@ impl democracy::Trait for Runtime {
type Scheduler = Scheduler;
type PalletsOrigin = OriginCaller;
type MaxVotes = MaxVotes;
type WeightInfo = ();
}
parameter_types! {
......@@ -475,6 +483,7 @@ impl collective::Trait<CouncilCollective> for Runtime {
type Event = Event;
type MotionDuration = CouncilMotionDuration;
type MaxProposals = CouncilMaxProposals;
type WeightInfo = ();
}
parameter_types! {
......@@ -505,6 +514,7 @@ impl elections_phragmen::Trait for Runtime {
type DesiredMembers = DesiredMembers;
type DesiredRunnersUp = DesiredRunnersUp;
type TermDuration = TermDuration;
type WeightInfo = ();
}
parameter_types! {
......@@ -519,6 +529,7 @@ impl collective::Trait<TechnicalCollective> for Runtime {
type Event = Event;
type MotionDuration = TechnicalMotionDuration;
type MaxProposals = TechnicalMaxProposals;
type WeightInfo = ();
}
impl membership::Trait<membership::Instance1> for Runtime {
......@@ -567,6 +578,7 @@ impl treasury::Trait for Runtime {
type ProposalBondMinimum = ProposalBondMinimum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type WeightInfo = ();
}
parameter_types! {
......@@ -578,6 +590,7 @@ impl offences::Trait for Runtime {
type IdentificationTuple = session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
type WeightInfo = ();
}
impl authority_discovery::Trait for Runtime {}
......@@ -597,6 +610,7 @@ impl im_online::Trait for Runtime {
type SessionDuration = SessionDuration;
type ReportUnresponsiveness = Offences;
type UnsignedPriority = ImOnlineUnsignedPriority;
type WeightInfo = ();
}
impl grandpa::Trait for Runtime {
......@@ -782,11 +796,13 @@ impl vesting::Trait for Runtime {
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = ();
}
impl utility::Trait for Runtime {
type Event = Event;
type Call = Call;
type WeightInfo = ();
}
parameter_types! {
......@@ -804,6 +820,7 @@ impl multisig::Trait for Runtime {
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
type WeightInfo = ();
}
impl sudo::Trait for Runtime {
......@@ -909,6 +926,7 @@ impl proxy::Trait for Runtime {
type ProxyDepositBase = ProxyDepositBase;
type ProxyDepositFactor = ProxyDepositFactor;
type MaxProxies = MaxProxies;
type WeightInfo = ();
}
pub struct CustomOnRuntimeUpgrade;
......
......@@ -155,6 +155,7 @@ impl system::Trait for Runtime {
type AccountData = balances::AccountData<Balance>;
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
}
impl<C> system::offchain::SendTransactionTypes<C> for Runtime where
......@@ -200,6 +201,7 @@ impl indices::Trait for Runtime {
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type WeightInfo = ();
}
parameter_types! {
......@@ -212,6 +214,7 @@ impl balances::Trait for Runtime {
type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
}
parameter_types! {
......@@ -233,6 +236,7 @@ impl timestamp::Trait for Runtime {
type Moment = u64;
type OnTimestampSet = Babe;
type MinimumPeriod = MinimumPeriod;
type WeightInfo = ();
}
parameter_types! {
......@@ -274,6 +278,7 @@ impl session::Trait for Runtime {
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
type WeightInfo = ();
}
impl session::historical::Trait for Runtime {
......@@ -329,6 +334,8 @@ impl staking::Trait for Runtime {
type UnsignedPriority = StakingUnsignedPriority;
type MaxIterations = MaxIterations;
type MinSolutionScoreBump = MinSolutionScoreBump;
type WeightInfo = ();
}
impl grandpa::Trait for Runtime {
......@@ -448,6 +455,7 @@ impl offences::Trait for Runtime {
type IdentificationTuple = session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
type WeightInfo = ();
}
parameter_types! {
......@@ -500,6 +508,7 @@ impl vesting::Trait for Runtime {
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = ();
}
construct_runtime! {
......
......@@ -137,6 +137,7 @@ impl system::Trait for Runtime {
type AccountData = balances::AccountData<Balance>;
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
}
impl scheduler::Trait for Runtime {
......@@ -146,6 +147,7 @@ impl scheduler::Trait for Runtime {
type Call = Call;
type MaximumWeight = MaximumBlockWeight;
type ScheduleOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
}
parameter_types! {
......@@ -185,6 +187,7 @@ impl indices::Trait for Runtime {
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type WeightInfo = ();
}
parameter_types! {
......@@ -197,6 +200,7 @@ impl balances::Trait for Runtime {
type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type WeightInfo = ();
}
parameter_types! {
......@@ -218,6 +222,7 @@ impl timestamp::Trait for Runtime {
type Moment = u64;
type OnTimestampSet = Babe;
type MinimumPeriod = MinimumPeriod;
type WeightInfo = ();
}
parameter_types! {
......@@ -261,6 +266,7 @@ impl session::Trait for Runtime {
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
type WeightInfo = ();
}
impl session::historical::Trait for Runtime {
......@@ -316,6 +322,7 @@ impl staking::Trait for Runtime {
type UnsignedPriority = StakingUnsignedPriority;
type MaxIterations = MaxIterations;
type MinSolutionScoreBump = MinSolutionScoreBump;
type WeightInfo = ();
}
parameter_types! {
......@@ -339,6 +346,7 @@ impl offences::Trait for Runtime {
type IdentificationTuple = session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
type WeightInfo = ();
}
impl authority_discovery::Trait for Runtime {}
......@@ -358,6 +366,7 @@ impl im_online::Trait for Runtime {
type ReportUnresponsiveness = Offences;
type SessionDuration = SessionDuration;
type UnsignedPriority = StakingUnsignedPriority;
type WeightInfo = ();
}
impl grandpa::Trait for Runtime {
......@@ -530,11 +539,13 @@ impl identity::Trait for Runtime {
type MaxRegistrars = MaxRegistrars;
type RegistrarOrigin = system::EnsureRoot<AccountId>;
type ForceOrigin = system::EnsureRoot<AccountId>;
type WeightInfo = ();
}
impl utility::Trait for Runtime {
type Event = Event;
type Call = Call;
type WeightInfo = ();
}
parameter_types! {
......@@ -552,6 +563,7 @@ impl multisig::Trait for Runtime {
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
type WeightInfo = ();
}
parameter_types! {
......@@ -580,6 +592,7 @@ impl vesting::Trait for Runtime {
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = ();
}
impl sudo::Trait for Runtime {
......@@ -679,6 +692,7 @@ impl proxy::Trait for Runtime {
type ProxyDepositBase = ProxyDepositBase;
type ProxyDepositFactor = ProxyDepositFactor;
type MaxProxies = MaxProxies;
type WeightInfo = ();
}
construct_runtime! {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment