Skip to content

Commit feb9eac

Browse files
authored
Merge pull request #140 from OriginTrail/release/testnet
Mainnet Runtime update
2 parents b82f079 + fdd48ef commit feb9eac

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtime/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "neuroweb-runtime"
3-
version = "146.0.0"
3+
version = "147.0.0"
44
authors = ["TraceLabs"]
55
description = "NeuroWeb Runtime - Cumulus FRAME-based Substrate Runtime"
66
license = "GPL-3.0-only"

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
152152
spec_name: create_runtime_str!("origintrail-parachain"),
153153
impl_name: create_runtime_str!("neuroweb"),
154154
authoring_version: 1,
155-
spec_version: 146,
155+
spec_version: 147,
156156
impl_version: 0,
157157
apis: RUNTIME_API_VERSIONS,
158158
transaction_version: 1,

runtime/src/xcm_config.rs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,30 @@ type Reserves = (
386386
NativeAsset,
387387
);
388388

389+
390+
parameter_types! {
391+
pub NativeAssetFilter: AssetFilter = Wild(AllOf { fun: WildFungible, id: TokenLocation::get().into() });
392+
pub AssetHubTrustedTeleporter: (AssetFilter, Location) = (NativeAssetFilter::get(), AssetHubLocation::get());
393+
394+
}
395+
396+
pub type TrustedTeleporters = (xcm_builder::Case<AssetHubTrustedTeleporter>,);
397+
398+
pub struct OnlyTeleportNative;
399+
impl Contains<(Location, Vec<Asset>)> for OnlyTeleportNative {
400+
fn contains(t: &(Location, Vec<Asset>)) -> bool {
401+
let native = TokenLocation::get();
402+
t.1.iter().all(|asset| {
403+
log::trace!(target: "xcm::OnlyTeleportNative", "Asset to be teleported: {:?}", asset);
404+
if let Asset { id: asset_id, fun: Fungible(_) } = asset {
405+
asset_id.0 == native
406+
} else {
407+
false
408+
}
409+
})
410+
}
411+
}
412+
389413
pub struct XcmConfig;
390414
impl xcm_executor::Config for XcmConfig {
391415
type RuntimeCall = RuntimeCall;
@@ -394,7 +418,7 @@ impl xcm_executor::Config for XcmConfig {
394418
type AssetTransactor = AssetTransactors;
395419
type OriginConverter = XcmOriginToTransactDispatchOrigin;
396420
type IsReserve = Reserves;
397-
type IsTeleporter = (); // Teleporting is disabled.
421+
type IsTeleporter = TrustedTeleporters;
398422
type UniversalLocation = UniversalLocation;
399423
type Barrier = Barrier;
400424
type Weigher = WeightInfoBounds<
@@ -452,7 +476,7 @@ impl pallet_xcm::Config for Runtime {
452476
// ^ Disable dispatchable execute on the XCM pallet.
453477
// Needs to be `Everything` for local testing.
454478
type XcmExecutor = XcmExecutor<XcmConfig>;
455-
type XcmTeleportFilter = Nothing;
479+
type XcmTeleportFilter = OnlyTeleportNative;
456480
type XcmReserveTransferFilter = Everything;
457481
type Weigher = WeightInfoBounds<
458482
crate::weights::xcm::NeurowebXcmWeight<RuntimeCall>,

0 commit comments

Comments
 (0)