Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change name of weight files for multiple pallet_balances instances of Kusama runtime. #58

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ impl pallet_balances::Config for Runtime {
type MaxLocks = MaxLocks;
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type WeightInfo = weights::pallet_balances_balances::WeightInfo<Runtime>;
type WeightInfo = weights::pallet_balances_native::WeightInfo<Runtime>;
type FreezeIdentifier = ();
type MaxFreezes = ();
type RuntimeHoldReason = RuntimeHoldReason;
Expand Down Expand Up @@ -1400,7 +1400,7 @@ impl pallet_balances::Config<NisCounterpartInstance> for Runtime {
type MaxLocks = ConstU32<4>;
type MaxReserves = ConstU32<4>;
type ReserveIdentifier = [u8; 8];
type WeightInfo = weights::pallet_balances_nis_counterpart_balances::WeightInfo<Runtime>;
type WeightInfo = weights::pallet_balances_nis::WeightInfo<Runtime>;
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
Expand Down Expand Up @@ -1571,7 +1571,6 @@ construct_runtime! {

// NIS pallet.
Nis: pallet_nis::{Pallet, Call, Storage, Event<T>, HoldReason} = 38,
// pub type NisCounterpartInstance = pallet_balances::Instance2;
NisCounterpartBalances: pallet_balances::<Instance2> = 45,

// Provides a semi-sorted list of nominators for staking.
Expand Down Expand Up @@ -1795,8 +1794,8 @@ mod benches {
[runtime_parachains::paras_inherent, ParaInherent]
[runtime_parachains::paras, Paras]
// Substrate
[pallet_balances, Balances]
[pallet_balances, NisCounterpartBalances]
[pallet_balances, Native]
[pallet_balances, Nis]
[pallet_bags_list, VoterList]
[frame_benchmarking::baseline, Baseline::<Runtime>]
[pallet_bounties, Bounties]
Expand Down Expand Up @@ -2331,6 +2330,13 @@ sp_api::impl_runtime_apis! {
use pallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench;
use frame_benchmarking::baseline::Pallet as Baseline;

// Benchmark files generated for `Balances/NisCounterpartBalances` instances are by default
// `pallet_balances_balances.rs / pallet_balances_nis_counterpart_balances`, which is not really nice,
// so with this redefinition we can change names to nicer:
// `pallet_balances_native.rs / pallet_balances_nis.rs`.
type Native = pallet_balances::Pallet::<Runtime, ()>;
type Nis = pallet_balances::Pallet::<Runtime, NisCounterpartInstance>;

let mut list = Vec::<BenchmarkList>::new();
list_benchmarks!(list, extra);

Expand Down Expand Up @@ -2455,6 +2461,9 @@ sp_api::impl_runtime_apis! {
}
}

type Native = pallet_balances::Pallet::<Runtime, ()>;
type Nis = pallet_balances::Pallet::<Runtime, NisCounterpartInstance>;

let mut whitelist: Vec<TrackedStorageKey> = AllPalletsWithSystem::whitelisted_storage_keys();
let treasury_key = frame_system::Account::<Runtime>::hashed_key_for(Treasury::account_id());
whitelist.push(treasury_key.to_vec().into());
Expand Down
4 changes: 2 additions & 2 deletions relay/kusama/src/weights/mod.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.