Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "neuroweb-runtime"
version = "146.0.0"
version = "147.0.0"
authors = ["TraceLabs"]
description = "NeuroWeb Runtime - Cumulus FRAME-based Substrate Runtime"
license = "GPL-3.0-only"
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("origintrail-parachain"),
impl_name: create_runtime_str!("neuroweb"),
authoring_version: 1,
spec_version: 146,
spec_version: 147,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
28 changes: 26 additions & 2 deletions runtime/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,30 @@ type Reserves = (
NativeAsset,
);


parameter_types! {
pub NativeAssetFilter: AssetFilter = Wild(AllOf { fun: WildFungible, id: TokenLocation::get().into() });
pub AssetHubTrustedTeleporter: (AssetFilter, Location) = (NativeAssetFilter::get(), AssetHubLocation::get());

}

pub type TrustedTeleporters = (xcm_builder::Case<AssetHubTrustedTeleporter>,);

pub struct OnlyTeleportNative;
impl Contains<(Location, Vec<Asset>)> for OnlyTeleportNative {
fn contains(t: &(Location, Vec<Asset>)) -> bool {
let native = TokenLocation::get();
t.1.iter().all(|asset| {
log::trace!(target: "xcm::OnlyTeleportNative", "Asset to be teleported: {:?}", asset);
if let Asset { id: asset_id, fun: Fungible(_) } = asset {
asset_id.0 == native
} else {
false
}
})
}
}

pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type RuntimeCall = RuntimeCall;
Expand All @@ -394,7 +418,7 @@ impl xcm_executor::Config for XcmConfig {
type AssetTransactor = AssetTransactors;
type OriginConverter = XcmOriginToTransactDispatchOrigin;
type IsReserve = Reserves;
type IsTeleporter = (); // Teleporting is disabled.
type IsTeleporter = TrustedTeleporters;
type UniversalLocation = UniversalLocation;
type Barrier = Barrier;
type Weigher = WeightInfoBounds<
Expand Down Expand Up @@ -452,7 +476,7 @@ impl pallet_xcm::Config for Runtime {
// ^ Disable dispatchable execute on the XCM pallet.
// Needs to be `Everything` for local testing.
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Nothing;
type XcmTeleportFilter = OnlyTeleportNative;
type XcmReserveTransferFilter = Everything;
type Weigher = WeightInfoBounds<
crate::weights::xcm::NeurowebXcmWeight<RuntimeCall>,
Expand Down
Loading