Skip to content

Commit 509831f

Browse files
committed
nits
1 parent 61a6b13 commit 509831f

File tree

8 files changed

+8
-24
lines changed

8 files changed

+8
-24
lines changed

modules/ismp/testsuite/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ anyhow = { workspace = true }
1616
[dependencies.polkadot-sdk]
1717
workspace = true
1818
default-features = true
19-
features = ["sp-core"]
19+
features = ["sp-core", "sp-runtime"]

modules/pallets/testsuite/src/xcm.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@ impl pallet_xcm_gateway::Config for Test {
432432
type Assets = Assets;
433433
type IsmpHost = Ismp;
434434
type GatewayOrigin = EnsureRoot<AccountId32>;
435-
type DotLocation = DotOnAssetHub;
436435
}
437436

438437
impl pallet_assets::Config for Test {

modules/pallets/xcm-gateway/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ pub mod pallet {
9999
type GatewayOrigin: EnsureOrigin<
100100
<Self as polkadot_sdk::frame_system::Config>::RuntimeOrigin,
101101
>;
102-
103-
type DotLocation: Get<Location>;
104102
}
105103

106104
#[pallet::storage]
@@ -339,6 +337,7 @@ where
339337
},
340338
}
341339
);
340+
342341
// parachains/solochains shouldn't be sending us a request.
343342
ensure!(
344343
!matches!(
@@ -390,7 +389,7 @@ where
390389
},
391390
})?;
392391

393-
let asset_id = T::DotLocation::get();
392+
let asset_id = Location::parent();
394393

395394
// We don't custody user funds, we send the dot back to assethub using xcm
396395
let xcm_beneficiary: Location =
@@ -485,7 +484,7 @@ where
485484
// on assethub;
486485
let xcm_beneficiary: Location =
487486
Junction::AccountId32 { network: None, id: body.from.0 }.into();
488-
let asset_id = T::DotLocation::get();
487+
let asset_id = Location::parent();
489488
let xcm_dest = VersionedLocation::V5(Location::new(1, [Parachain(ASSET_HUB_PARA_ID)]));
490489
let fee_asset_item = 0;
491490
let weight_limit = WeightLimit::Unlimited;

modules/pallets/xcm-gateway/src/xcm_utilities.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use frame_support::traits::{
2323
};
2424
use ismp::host::StateMachine;
2525
use polkadot_sdk::*;
26-
use polkadot_sdk::cumulus_primitives_core::Here;
2726
use sp_core::{Get, H160};
2827
use sp_runtime::traits::MaybeEquivalence;
2928
use staging_xcm::v5::{
@@ -36,7 +35,6 @@ use staging_xcm_executor::{
3635
AssetsInHolding,
3736
};
3837
pub const ASSET_HUB_PARA_ID: u32 = 1000;
39-
pub const NATIVE_ASSET_ID_ON_ASSET_HUB: u128 = 0;
4038
pub struct WrappedNetworkId(pub NetworkId);
4139

4240
impl TryFrom<WrappedNetworkId> for StateMachine {
@@ -128,7 +126,7 @@ pub struct ReserveTransferFilter;
128126

129127
impl Contains<(Location, Vec<Asset>)> for ReserveTransferFilter {
130128
fn contains(t: &(Location, Vec<Asset>)) -> bool {
131-
let native = Location::new(1, Here);
129+
let native = Location::parent();
132130
t.1.iter().all(|asset| {
133131
if let Asset { id: asset_id, fun: Fungible(_) } = asset {
134132
asset_id.0 == native

parachain/runtimes/gargantua/src/ismp.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use crate::{
1919
Runtime, RuntimeEvent, Timestamp, TokenGatewayInspector, TokenGovernor, TreasuryPalletId,
2020
XcmGateway, EXISTENTIAL_DEPOSIT,
2121
};
22-
use crate::xcm::DotOnAssetHub;
2322
use anyhow::anyhow;
2423
use frame_support::{
2524
pallet_prelude::{ConstU32, Get},
@@ -198,7 +197,6 @@ impl pallet_xcm_gateway::Config for Runtime {
198197
type Assets = Assets;
199198
type IsmpHost = Ismp;
200199
type GatewayOrigin = EnsureRoot<AccountId>;
201-
type DotLocation = DotOnAssetHub;
202200
}
203201

204202
impl pallet_token_gateway_inspector::Config for Runtime {

parachain/runtimes/gargantua/src/xcm.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use staging_xcm_builder::{
4040
};
4141
use staging_xcm_executor::XcmExecutor;
4242

43-
use pallet_xcm_gateway::xcm_utilities::{ASSET_HUB_PARA_ID, ConvertAssetId, HyperbridgeAssetTransactor, NATIVE_ASSET_ID_ON_ASSET_HUB, ReserveTransferFilter};
43+
use pallet_xcm_gateway::xcm_utilities::{ASSET_HUB_PARA_ID, ConvertAssetId, HyperbridgeAssetTransactor, ReserveTransferFilter};
4444

4545
parameter_types! {
4646
pub const RelayLocation: Location = Location::parent();
@@ -149,10 +149,6 @@ impl ContainsPair<Asset, Location> for MultiNativeAsset {
149149
}
150150
}
151151

152-
parameter_types! {
153-
pub DotOnAssetHub: Location = Location::new(1, Here);
154-
}
155-
156152
pub struct AssetsFromAssetHub;
157153
impl ContainsPair<Asset, Location> for AssetsFromAssetHub {
158154
fn contains(asset: &Asset, origin: &Location) -> bool {
@@ -164,7 +160,7 @@ impl ContainsPair<Asset, Location> for AssetsFromAssetHub {
164160
let asset_hub = Location::new(1, [Parachain(ASSET_HUB_PARA_ID)]);
165161
if origin == &asset_hub {
166162
let AssetId(asset_id) = &asset.id;
167-
return DotOnAssetHub::get() == *asset_id;
163+
return Parent == *asset_id;
168164
}
169165

170166
false

parachain/runtimes/nexus/src/ismp.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use crate::{
1919
ReputationAsset, Runtime, RuntimeEvent, Timestamp, TokenGatewayInspector, TokenGovernor,
2020
TreasuryPalletId, XcmGateway, EXISTENTIAL_DEPOSIT,
2121
};
22-
use crate::xcm::DotOnAssetHub;
2322
use frame_support::{
2423
pallet_prelude::{ConstU32, Get},
2524
parameter_types,
@@ -249,7 +248,6 @@ impl pallet_xcm_gateway::Config for Runtime {
249248
MIN_TECH_COLLECTIVE_APPROVAL,
250249
>,
251250
>;
252-
type DotLocation = DotOnAssetHub;
253251
}
254252

255253
impl pallet_token_governor::Config for Runtime {

parachain/runtimes/nexus/src/xcm.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl ContainsPair<Asset, Location> for AssetsFromAssetHub {
145145
let asset_hub = Location::new(1, [Parachain(ASSET_HUB_PARA_ID)]);
146146
if origin == &asset_hub {
147147
let AssetId(asset_id) = &asset.id;
148-
return DotOnAssetHub::get() == *asset_id;
148+
return Parent == *asset_id;
149149
}
150150

151151
false
@@ -209,10 +209,6 @@ parameter_types! {
209209
pub ReachableDest: Option<Location> = Some(Parent.into());
210210
}
211211

212-
parameter_types! {
213-
pub DotOnAssetHub: Location = Location::new(1, Here);
214-
}
215-
216212
impl pallet_xcm::Config for Runtime {
217213
type RuntimeEvent = RuntimeEvent;
218214
type Currency = Balances;

0 commit comments

Comments
 (0)