Skip to content

Commit

Permalink
disable pallet_xcm benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
zjb0807 committed May 30, 2024
1 parent 33281f8 commit 3f5b059
Show file tree
Hide file tree
Showing 3 changed files with 269 additions and 269 deletions.
156 changes: 78 additions & 78 deletions runtime/acala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2371,11 +2371,11 @@ sp_api::impl_runtime_apis! {
use frame_benchmarking::{Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait;
use module_nft::benchmarking::Pallet as NftBench;
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
// use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;

let mut list = Vec::<BenchmarkList>::new();

// frame_list_benchmark!(list, extra, module_nft, NftBench::<Runtime>);
frame_list_benchmark!(list, extra, module_nft, NftBench::<Runtime>);
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
Expand All @@ -2390,82 +2390,82 @@ sp_api::impl_runtime_apis! {
use module_nft::benchmarking::Pallet as NftBench;
use frame_support::traits::{WhitelistedStorageKeys, TrackedStorageKey};

const UNITS: Balance = 1_000_000_000_000;
const CENTS: Balance = UNITS / 100;

parameter_types! {
pub FeeAssetId: AssetId = AssetId(Location::parent());
pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3);
}
pub type PriceForParentDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
FeeAssetId,
BaseDeliveryFee,
TransactionByteFee,
ParachainSystem,
>;

use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
impl pallet_xcm::benchmarking::Config for Runtime {
type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
xcm_config::XcmConfig,
ExistentialDepositAsset,
PriceForParentDelivery,
>;
fn reachable_dest() -> Option<Location> {
Some(Parent.into())
}

fn teleportable_asset_and_dest() -> Option<(Asset, Location)> {
Some((
Asset {
fun: Fungible(NativeTokenExistentialDeposit::get()),
id: AssetId(Parent.into())
},
Parent.into(),
))
}

fn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)> {
None
}

fn get_asset() -> Asset {
Asset {
id: AssetId(Location::parent()),
fun: Fungible(UNITS),
}
}
}

parameter_types! {
pub ExistentialDepositAsset: Option<Asset> = Some((
Location::parent(),
NativeTokenExistentialDeposit::get()
).into());
}

impl pallet_xcm_benchmarks::Config for Runtime {
type XcmConfig = xcm_config::XcmConfig;
type AccountIdConverter = xcm_config::LocationToAccountId;
type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
xcm_config::XcmConfig,
ExistentialDepositAsset,
PriceForParentDelivery,
>;
fn valid_destination() -> Result<Location, BenchmarkError> {
Ok(Location::parent())
}
fn worst_case_holding(_depositable_count: u32) -> Assets {
// just concrete assets according to relay chain.
let assets: Vec<Asset> = vec![
Asset {
id: AssetId(Location::parent()),
fun: Fungible(1_000_000 * UNITS),
}
];
assets.into()
}
}
// const UNITS: Balance = 1_000_000_000_000;
// const CENTS: Balance = UNITS / 100;

// parameter_types! {
// pub FeeAssetId: AssetId = AssetId(Location::parent());
// pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3);
// }
// pub type PriceForParentDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
// FeeAssetId,
// BaseDeliveryFee,
// TransactionByteFee,
// ParachainSystem,
// >;

// use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
// impl pallet_xcm::benchmarking::Config for Runtime {
// type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
// xcm_config::XcmConfig,
// ExistentialDepositAsset,
// PriceForParentDelivery,
// >;
// fn reachable_dest() -> Option<Location> {
// Some(Parent.into())
// }

// fn teleportable_asset_and_dest() -> Option<(Asset, Location)> {
// Some((
// Asset {
// fun: Fungible(NativeTokenExistentialDeposit::get()),
// id: AssetId(Parent.into())
// },
// Parent.into(),
// ))
// }

// fn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)> {
// None
// }

// fn get_asset() -> Asset {
// Asset {
// id: AssetId(Location::parent()),
// fun: Fungible(UNITS),
// }
// }
// }

// parameter_types! {
// pub ExistentialDepositAsset: Option<Asset> = Some((
// Location::parent(),
// NativeTokenExistentialDeposit::get()
// ).into());
// }

// impl pallet_xcm_benchmarks::Config for Runtime {
// type XcmConfig = xcm_config::XcmConfig;
// type AccountIdConverter = xcm_config::LocationToAccountId;
// type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
// xcm_config::XcmConfig,
// ExistentialDepositAsset,
// PriceForParentDelivery,
// >;
// fn valid_destination() -> Result<Location, BenchmarkError> {
// Ok(Location::parent())
// }
// fn worst_case_holding(_depositable_count: u32) -> Assets {
// // just concrete assets according to relay chain.
// let assets: Vec<Asset> = vec![
// Asset {
// id: AssetId(Location::parent()),
// fun: Fungible(1_000_000 * UNITS),
// }
// ];
// assets.into()
// }
// }

let mut whitelist: Vec<TrackedStorageKey> = AllPalletsWithSystem::whitelisted_storage_keys();

Expand Down
156 changes: 78 additions & 78 deletions runtime/karura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2397,11 +2397,11 @@ impl_runtime_apis! {
use frame_benchmarking::{Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait;
use module_nft::benchmarking::Pallet as NftBench;
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
// use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;

let mut list = Vec::<BenchmarkList>::new();

// frame_list_benchmark!(list, extra, module_nft, NftBench::<Runtime>);
frame_list_benchmark!(list, extra, module_nft, NftBench::<Runtime>);
list_benchmarks!(list, extra);

let storage_info = AllPalletsWithSystem::storage_info();
Expand All @@ -2416,82 +2416,82 @@ impl_runtime_apis! {
use module_nft::benchmarking::Pallet as NftBench;
use frame_support::traits::{WhitelistedStorageKeys, TrackedStorageKey};

const UNITS: Balance = 1_000_000_000_000;
const CENTS: Balance = UNITS / 100;

parameter_types! {
pub FeeAssetId: AssetId = AssetId(Location::parent());
pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3);
}
pub type PriceForParentDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
FeeAssetId,
BaseDeliveryFee,
TransactionByteFee,
ParachainSystem,
>;

use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
impl pallet_xcm::benchmarking::Config for Runtime {
type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
xcm_config::XcmConfig,
ExistentialDepositAsset,
PriceForParentDelivery,
>;
fn reachable_dest() -> Option<Location> {
Some(Parent.into())
}

fn teleportable_asset_and_dest() -> Option<(Asset, Location)> {
Some((
Asset {
fun: Fungible(NativeTokenExistentialDeposit::get()),
id: AssetId(Parent.into())
},
Parent.into(),
))
}

fn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)> {
None
}

fn get_asset() -> Asset {
Asset {
id: AssetId(Location::parent()),
fun: Fungible(UNITS),
}
}
}

parameter_types! {
pub ExistentialDepositAsset: Option<Asset> = Some((
Location::parent(),
NativeTokenExistentialDeposit::get()
).into());
}

impl pallet_xcm_benchmarks::Config for Runtime {
type XcmConfig = xcm_config::XcmConfig;
type AccountIdConverter = xcm_config::LocationToAccountId;
type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
xcm_config::XcmConfig,
ExistentialDepositAsset,
PriceForParentDelivery,
>;
fn valid_destination() -> Result<Location, BenchmarkError> {
Ok(Location::parent())
}
fn worst_case_holding(_depositable_count: u32) -> Assets {
// just concrete assets according to relay chain.
let assets: Vec<Asset> = vec![
Asset {
id: AssetId(Location::parent()),
fun: Fungible(1_000_000 * UNITS),
}
];
assets.into()
}
}
// const UNITS: Balance = 1_000_000_000_000;
// const CENTS: Balance = UNITS / 100;

// parameter_types! {
// pub FeeAssetId: AssetId = AssetId(Location::parent());
// pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3);
// }
// pub type PriceForParentDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
// FeeAssetId,
// BaseDeliveryFee,
// TransactionByteFee,
// ParachainSystem,
// >;

// use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
// impl pallet_xcm::benchmarking::Config for Runtime {
// type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
// xcm_config::XcmConfig,
// ExistentialDepositAsset,
// PriceForParentDelivery,
// >;
// fn reachable_dest() -> Option<Location> {
// Some(Parent.into())
// }

// fn teleportable_asset_and_dest() -> Option<(Asset, Location)> {
// Some((
// Asset {
// fun: Fungible(NativeTokenExistentialDeposit::get()),
// id: AssetId(Parent.into())
// },
// Parent.into(),
// ))
// }

// fn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)> {
// None
// }

// fn get_asset() -> Asset {
// Asset {
// id: AssetId(Location::parent()),
// fun: Fungible(UNITS),
// }
// }
// }

// parameter_types! {
// pub ExistentialDepositAsset: Option<Asset> = Some((
// Location::parent(),
// NativeTokenExistentialDeposit::get()
// ).into());
// }

// impl pallet_xcm_benchmarks::Config for Runtime {
// type XcmConfig = xcm_config::XcmConfig;
// type AccountIdConverter = xcm_config::LocationToAccountId;
// type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
// xcm_config::XcmConfig,
// ExistentialDepositAsset,
// PriceForParentDelivery,
// >;
// fn valid_destination() -> Result<Location, BenchmarkError> {
// Ok(Location::parent())
// }
// fn worst_case_holding(_depositable_count: u32) -> Assets {
// // just concrete assets according to relay chain.
// let assets: Vec<Asset> = vec![
// Asset {
// id: AssetId(Location::parent()),
// fun: Fungible(1_000_000 * UNITS),
// }
// ];
// assets.into()
// }
// }

let mut whitelist: Vec<TrackedStorageKey> = AllPalletsWithSystem::whitelisted_storage_keys();

Expand Down
Loading

0 comments on commit 3f5b059

Please sign in to comment.