Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 1fcfaed

Browse files
authored
AssetHubs - split weights for pallet_assets (#2743)
* AssetHubs - split weights for pallet_assets * ".git/.scripts/commands/bench/bench.sh" pallet asset-hub-kusama assets pallet_assets * ".git/.scripts/commands/bench/bench.sh" pallet asset-hub-kusama assets pallet_assets * ".git/.scripts/commands/bench/bench.sh" pallet asset-hub-westend assets pallet_assets * ".git/.scripts/commands/bench/bench.sh" pallet asset-hub-polkadot assets pallet_assets * ".git/.scripts/commands/bench/bench.sh" pallet asset-hub-westend assets pallet_assets * ".git/.scripts/commands/bench/bench.sh" pallet asset-hub-polkadot assets pallet_assets * Rename weight file for pallet_assets instances (polkadot) * ".git/.scripts/commands/bench/bench.sh" pallet asset-hub-polkadot assets pallet_assets * Rename weight file for pallet_assets instances (kusama/westend) * ".git/.scripts/commands/bench/bench.sh" pallet asset-hub-kusama assets pallet_assets * ".git/.scripts/commands/bench/bench.sh" pallet asset-hub-westend assets pallet_assets * Changed `pallet_assets_remote` -> `pallet_assets_foreign` * fmt * ".git/.scripts/commands/bench/bench.sh" pallet asset-hub-kusama assets pallet_assets * ".git/.scripts/commands/bench/bench.sh" pallet asset-hub-westend assets pallet_assets * ".git/.scripts/commands/bench/bench.sh" pallet asset-hub-polkadot assets pallet_assets --------- Co-authored-by: parity-processbot <>
1 parent 7be4c26 commit 1fcfaed

File tree

12 files changed

+2085
-418
lines changed

12 files changed

+2085
-418
lines changed

parachains/runtimes/assets/asset-hub-kusama/src/lib.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
269269
type StringLimit = AssetsStringLimit;
270270
type Freezer = ();
271271
type Extra = ();
272-
type WeightInfo = weights::pallet_assets::WeightInfo<Runtime>;
272+
type WeightInfo = weights::pallet_assets_local::WeightInfo<Runtime>;
273273
type CallbackHandle = ();
274274
type AssetAccountDeposit = AssetAccountDeposit;
275275
type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
@@ -311,7 +311,7 @@ impl pallet_assets::Config<ForeignAssetsInstance> for Runtime {
311311
type StringLimit = ForeignAssetsAssetsStringLimit;
312312
type Freezer = ();
313313
type Extra = ();
314-
type WeightInfo = weights::pallet_assets::WeightInfo<Runtime>;
314+
type WeightInfo = weights::pallet_assets_foreign::WeightInfo<Runtime>;
315315
type CallbackHandle = ();
316316
type AssetAccountDeposit = ForeignAssetsAssetAccountDeposit;
317317
type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
@@ -798,8 +798,8 @@ extern crate frame_benchmarking;
798798
mod benches {
799799
define_benchmarks!(
800800
[frame_system, SystemBench::<Runtime>]
801-
[pallet_assets, Assets]
802-
[pallet_assets, ForeignAssets]
801+
[pallet_assets, Local]
802+
[pallet_assets, Foreign]
803803
[pallet_balances, Balances]
804804
[pallet_multisig, Multisig]
805805
[pallet_nfts, Nfts]
@@ -1032,6 +1032,13 @@ impl_runtime_apis! {
10321032
type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
10331033
type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::<Runtime>;
10341034

1035+
// Benchmark files generated for `Assets/ForeignAssets` instances are by default
1036+
// `pallet_assets_assets.rs / pallet_assets_foreign_assets`, which is not really nice,
1037+
// so with this redefinition we can change names to nicer:
1038+
// `pallet_assets_local.rs / pallet_assets_foreign.rs`.
1039+
type Local = pallet_assets::Pallet::<Runtime, TrustBackedAssetsInstance>;
1040+
type Foreign = pallet_assets::Pallet::<Runtime, ForeignAssetsInstance>;
1041+
10351042
let mut list = Vec::<BenchmarkList>::new();
10361043
list_benchmarks!(list, extra);
10371044

@@ -1158,6 +1165,9 @@ impl_runtime_apis! {
11581165
type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
11591166
type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::<Runtime>;
11601167

1168+
type Local = pallet_assets::Pallet::<Runtime, TrustBackedAssetsInstance>;
1169+
type Foreign = pallet_assets::Pallet::<Runtime, ForeignAssetsInstance>;
1170+
11611171
let whitelist: Vec<TrackedStorageKey> = vec![
11621172
// Block Number
11631173
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),

parachains/runtimes/assets/asset-hub-kusama/src/weights/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ pub mod block_weights;
22
pub mod cumulus_pallet_xcmp_queue;
33
pub mod extrinsic_weights;
44
pub mod frame_system;
5-
pub mod pallet_assets;
5+
pub mod pallet_assets_foreign;
6+
pub mod pallet_assets_local;
67
pub mod pallet_balances;
78
pub mod pallet_collator_selection;
89
pub mod pallet_multisig;

0 commit comments

Comments
 (0)