Skip to content

Commit

Permalink
Remove unused weight files (#57)
Browse files Browse the repository at this point in the history
Deleting the weight files of all pallets that were undeployed by the
OpenGov migration.
Kusama still had one duplicate file for the balances.  
Also contains #58

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 10, 2024
1 parent b8f26c1 commit a205a9a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
19 changes: 14 additions & 5 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,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 = RuntimeFreezeReason;
type MaxFreezes = ConstU32<8>;
type RuntimeHoldReason = RuntimeHoldReason;
Expand Down Expand Up @@ -1406,7 +1406,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 RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
Expand Down Expand Up @@ -1591,7 +1591,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 @@ -1721,8 +1720,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 @@ -2281,6 +2280,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 @@ -2421,6 +2427,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.

0 comments on commit a205a9a

Please sign in to comment.