Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Remove explicit Snowbridge teleports #77

Merged
merged 1 commit into from
Dec 19, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use snowbridge_rococo_common::EthereumNetwork;
use snowbridge_router_primitives::inbound::GlobalConsensusEthereumConvertsFor;
use sp_runtime::traits::{AccountIdConversion, ConvertInto};
use sp_std::marker::PhantomData;
use xcm::latest::prelude::*;
#[allow(deprecated)]
use xcm_builder::CurrencyAdapter;
Expand All @@ -61,7 +60,6 @@ use xcm_executor::{traits::WithOriginFilter, XcmExecutor};

#[cfg(feature = "runtime-benchmarks")]
use cumulus_primitives_core::ParaId;
use frame_support::traits::{ContainsPair, Get};

parameter_types! {
pub const TokenLocation: MultiLocation = MultiLocation::parent();
Expand Down Expand Up @@ -536,7 +534,6 @@ pub type WaivedLocations = (
/// - Sibling parachains' assets from where they originate (as `ForeignCreators`).
pub type TrustedTeleporters = (
ConcreteAssetFromSystem<TokenLocation>,
ConcreteAssetFromSnowBridgeMessageQueue<TokenLocation>,
IsForeignConcreteAsset<FromSiblingParachain<parachain_info::Pallet<Runtime>>>,
);

Expand Down Expand Up @@ -720,18 +717,6 @@ where
}
}

pub struct ConcreteAssetFromSnowBridgeMessageQueue<AssetLocation>(PhantomData<AssetLocation>);
impl<AssetLocation: Get<MultiLocation>> ContainsPair<MultiAsset, MultiLocation>
for ConcreteAssetFromSnowBridgeMessageQueue<AssetLocation>
{
fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool {
log::trace!(target: "xcm::contains", "ConcreteAssetFromSystem asset: {:?}, origin: {:?}", asset, origin);
let from_snowbridge = origin
.eq(&bridging::to_ethereum::SiblingBridgeHubWithEthereumInboundQueueInstance::get());
matches!(asset.id, Concrete(id) if id == AssetLocation::get()) && from_snowbridge
}
}

/// All configuration related to bridging
pub mod bridging {
use super::*;
Expand Down
Loading