More Improvements to Benchmarking CLI + Generic WeightInfo (#7168)

* Generic WeightInfo, Output File Path

* Make `WeightInfo` generic

* Add support for header file

* fix line width

* add `--spaces` flag

* Configurable trait and struct strings

* make elections phragmen generic

* Add date to generated file

* Apply suggestions from code review

Co-authored-by: Gavin Wood <gavin@parity.io>

* fixes

* add settings metadata to output

Co-authored-by: nikvolf <nikvolf@gmail.com>
Co-authored-by: Gavin Wood <gavin@parity.io>
This commit is contained in:
Shawn Tabrizi
2020-09-23 15:56:30 +02:00
committed by GitHub
parent 313f86ec23
commit 4e5f9fb72b
25 changed files with 583 additions and 426 deletions
+18 -18
View File
@@ -183,13 +183,13 @@ impl frame_system::Trait for Runtime {
type AccountData = pallet_balances::AccountData<Balance>;
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = weights::frame_system::WeightInfo;
type SystemWeightInfo = weights::frame_system::WeightInfo<Runtime>;
}
impl pallet_utility::Trait for Runtime {
type Event = Event;
type Call = Call;
type WeightInfo = weights::pallet_utility::WeightInfo;
type WeightInfo = weights::pallet_utility::WeightInfo<Runtime>;
}
parameter_types! {
@@ -207,7 +207,7 @@ impl pallet_multisig::Trait for Runtime {
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
type WeightInfo = weights::pallet_multisig::WeightInfo;
type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
}
parameter_types! {
@@ -271,7 +271,7 @@ impl pallet_proxy::Trait for Runtime {
type ProxyDepositBase = ProxyDepositBase;
type ProxyDepositFactor = ProxyDepositFactor;
type MaxProxies = MaxProxies;
type WeightInfo = weights::pallet_proxy::WeightInfo;
type WeightInfo = weights::pallet_proxy::WeightInfo<Runtime>;
type MaxPending = MaxPending;
type CallHasher = BlakeTwo256;
type AnnouncementDepositBase = AnnouncementDepositBase;
@@ -291,7 +291,7 @@ impl pallet_scheduler::Trait for Runtime {
type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = EnsureRoot<AccountId>;
type MaxScheduledPerBlock = MaxScheduledPerBlock;
type WeightInfo = weights::pallet_scheduler::WeightInfo;
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
}
parameter_types! {
@@ -331,7 +331,7 @@ impl pallet_indices::Trait for Runtime {
type Currency = Balances;
type Deposit = IndexDeposit;
type Event = Event;
type WeightInfo = weights::pallet_indices::WeightInfo;
type WeightInfo = weights::pallet_indices::WeightInfo<Runtime>;
}
parameter_types! {
@@ -348,7 +348,7 @@ impl pallet_balances::Trait for Runtime {
type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = frame_system::Module<Runtime>;
type WeightInfo = weights::pallet_balances::WeightInfo;
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
}
parameter_types! {
@@ -375,7 +375,7 @@ impl pallet_timestamp::Trait for Runtime {
type Moment = Moment;
type OnTimestampSet = Babe;
type MinimumPeriod = MinimumPeriod;
type WeightInfo = weights::pallet_timestamp::WeightInfo;
type WeightInfo = weights::pallet_timestamp::WeightInfo<Runtime>;
}
parameter_types! {
@@ -412,7 +412,7 @@ impl pallet_session::Trait for Runtime {
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
type WeightInfo = weights::pallet_session::WeightInfo;
type WeightInfo = weights::pallet_session::WeightInfo<Runtime>;
}
impl pallet_session::historical::Trait for Runtime {
@@ -469,7 +469,7 @@ impl pallet_staking::Trait for Runtime {
type MinSolutionScoreBump = MinSolutionScoreBump;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type UnsignedPriority = StakingUnsignedPriority;
type WeightInfo = weights::pallet_staking::WeightInfo;
type WeightInfo = weights::pallet_staking::WeightInfo<Runtime>;
}
parameter_types! {
@@ -518,7 +518,7 @@ impl pallet_democracy::Trait for Runtime {
type Scheduler = Scheduler;
type PalletsOrigin = OriginCaller;
type MaxVotes = MaxVotes;
type WeightInfo = weights::pallet_democracy::WeightInfo;
type WeightInfo = weights::pallet_democracy::WeightInfo<Runtime>;
}
parameter_types! {
@@ -536,7 +536,7 @@ impl pallet_collective::Trait<CouncilCollective> for Runtime {
type MaxProposals = CouncilMaxProposals;
type MaxMembers = CouncilMaxMembers;
type DefaultVote = pallet_collective::PrimeDefaultVote;
type WeightInfo = weights::pallet_collective::WeightInfo;
type WeightInfo = weights::pallet_collective::WeightInfo<Runtime>;
}
parameter_types! {
@@ -568,7 +568,7 @@ impl pallet_elections_phragmen::Trait for Runtime {
type DesiredMembers = DesiredMembers;
type DesiredRunnersUp = DesiredRunnersUp;
type TermDuration = TermDuration;
type WeightInfo = weights::pallet_elections_phragmen::WeightInfo;
type WeightInfo = weights::pallet_elections_phragmen::WeightInfo<Runtime>;
}
parameter_types! {
@@ -586,7 +586,7 @@ impl pallet_collective::Trait<TechnicalCollective> for Runtime {
type MaxProposals = TechnicalMaxProposals;
type MaxMembers = TechnicalMaxMembers;
type DefaultVote = pallet_collective::PrimeDefaultVote;
type WeightInfo = weights::pallet_collective::WeightInfo;
type WeightInfo = weights::pallet_collective::WeightInfo<Runtime>;
}
type EnsureRootOrHalfCouncil = EnsureOneOf<
@@ -654,7 +654,7 @@ impl pallet_treasury::Trait for Runtime {
type BountyValueMinimum = BountyValueMinimum;
type MaximumReasonLength = MaximumReasonLength;
type BurnDestination = ();
type WeightInfo = weights::pallet_treasury::WeightInfo;
type WeightInfo = weights::pallet_treasury::WeightInfo<Runtime>;
}
parameter_types! {
@@ -759,7 +759,7 @@ impl pallet_im_online::Trait for Runtime {
type SessionDuration = SessionDuration;
type ReportUnresponsiveness = Offences;
type UnsignedPriority = ImOnlineUnsignedPriority;
type WeightInfo = weights::pallet_im_online::WeightInfo;
type WeightInfo = weights::pallet_im_online::WeightInfo<Runtime>;
}
parameter_types! {
@@ -827,7 +827,7 @@ impl pallet_identity::Trait for Runtime {
type Slashed = Treasury;
type ForceOrigin = EnsureRootOrHalfCouncil;
type RegistrarOrigin = EnsureRootOrHalfCouncil;
type WeightInfo = weights::pallet_identity::WeightInfo;
type WeightInfo = weights::pallet_identity::WeightInfo<Runtime>;
}
parameter_types! {
@@ -884,7 +884,7 @@ impl pallet_vesting::Trait for Runtime {
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = weights::pallet_vesting::WeightInfo;
type WeightInfo = weights::pallet_vesting::WeightInfo<Runtime>;
}
construct_runtime!(