Skip to content

Commit

Permalink
Fixed benchmark code
Browse files Browse the repository at this point in the history
  • Loading branch information
zktony committed May 30, 2024
1 parent 95832aa commit fcbfbeb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ serde = { version = "1.0.171", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.102", default-features = false, features = ["alloc"] }
hash-db = { version = "0.16.0", default-features = false }
trie-db = { version = "0.27.1", default-features = false }

#Parachain Dependencies
cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
orml-xtokens = { git = "https://github.com/Polkadex-Substrate/orml-1.1.0.git", branch = "master", default-features = false } #FIXME: Remove rev
Expand All @@ -204,7 +203,7 @@ cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branc
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
cumulus-primitives-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
#Here Oeml
#Here Orml
orml-xcm-support = { git = "https://github.com/Polkadex-Substrate/orml-1.1.0.git", branch = "master", default-features = false } #FIXME: Remove rev
pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
Expand Down
24 changes: 14 additions & 10 deletions polkadex-xcm-simulator/src/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,16 +448,6 @@ parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(Parent.into());
}

pub struct TrustedLockerCase<T>(PhantomData<T>);
impl<T: Get<(MultiLocation, MultiAssetFilter)>> ContainsPair<MultiLocation, MultiAsset>
for TrustedLockerCase<T>
{
fn contains(origin: &MultiLocation, asset: &MultiAsset) -> bool {
let (o, a) = T::get();
a.matches(asset) && &o == origin
}
}

parameter_types! {
pub RelayTokenForRelay: (MultiLocation, MultiAssetFilter) = (Parent.into(), Wild(AllOf { id: Concrete(Parent.into()), fun: WildFungible }));
}
Expand Down Expand Up @@ -518,6 +508,20 @@ impl pallet_assets::Config for Runtime {
type Extra = ();
type CallbackHandle = ();
type WeightInfo = ();
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = AssetU128;
}

#[cfg(feature = "runtime-benchmarks")]
pub struct AssetU128;
#[cfg(feature = "runtime-benchmarks")]
use pallet_assets::BenchmarkHelper;

#[cfg(feature = "runtime-benchmarks")]
impl BenchmarkHelper<codec::Compact<u128>> for AssetU128 {
fn create_asset_id_parameter(id: u32) -> codec::Compact<u128> {
codec::Compact::from(id as u128)
}
}

pub const POLKADEX_NATIVE_ASSET_ID: u128 = 0;
Expand Down

0 comments on commit fcbfbeb

Please sign in to comment.