diff --git a/parachain/primitives/router/src/inbound/mod.rs b/parachain/primitives/router/src/inbound/mod.rs index d740664e18..a07e0eae5d 100644 --- a/parachain/primitives/router/src/inbound/mod.rs +++ b/parachain/primitives/router/src/inbound/mod.rs @@ -7,11 +7,7 @@ mod tests; use codec::{Decode, Encode}; use core::marker::PhantomData; -use frame_support::{ - traits::{tokens::Balance as BalanceT, ContainsPair}, - weights::Weight, - PalletError, -}; +use frame_support::{traits::tokens::Balance as BalanceT, weights::Weight, PalletError}; use scale_info::TypeInfo; use sp_core::{Get, RuntimeDebug, H160}; use sp_io::hashing::blake2_256; @@ -302,17 +298,6 @@ where } } -pub struct FromEthereumGlobalConsensus(PhantomData); -impl ContainsPair - for FromEthereumGlobalConsensus -where - EthereumBridgeLocation: Get, -{ - fn contains(asset: &MultiLocation, origin: &MultiLocation) -> bool { - origin == &EthereumBridgeLocation::get() && asset.starts_with(origin) - } -} - pub struct GlobalConsensusEthereumConvertsFor(PhantomData); impl ConvertLocation for GlobalConsensusEthereumConvertsFor where diff --git a/parachain/primitives/router/src/inbound/tests.rs b/parachain/primitives/router/src/inbound/tests.rs index 176784f3e0..770ba42a88 100644 --- a/parachain/primitives/router/src/inbound/tests.rs +++ b/parachain/primitives/router/src/inbound/tests.rs @@ -1,6 +1,6 @@ -use super::{FromEthereumGlobalConsensus, GlobalConsensusEthereumConvertsFor}; +use super::GlobalConsensusEthereumConvertsFor; use crate::inbound::CallIndex; -use frame_support::{parameter_types, traits::ContainsPair}; +use frame_support::parameter_types; use hex_literal::hex; use sp_core::crypto::Ss58Codec; use xcm::v3::prelude::*; @@ -14,7 +14,6 @@ const EXPECTED_SOVEREIGN_ADDRESS: &str = "HF3T62xRQvoCCowYamEQweEyWbD5yt4mkET8Uk parameter_types! { pub EthereumNetwork: NetworkId = NETWORK; - pub EthereumLocation: MultiLocation = MultiLocation::new(2, X1(GlobalConsensus(EthereumNetwork::get()))); pub const CreateAssetCall: CallIndex = [1, 1]; pub const CreateAssetExecutionFee: u128 = 123; @@ -63,32 +62,3 @@ fn test_contract_location_with_incorrect_location_fails_convert() { None, ); } - -#[test] -fn test_from_ethereum_global_consensus_with_containing_asset_yields_true() { - let origin = MultiLocation { parents: 2, interior: X1(GlobalConsensus(NETWORK)) }; - let asset = MultiLocation { - parents: 2, - interior: X2(GlobalConsensus(NETWORK), AccountKey20 { network: None, key: [0; 20] }), - }; - assert!(FromEthereumGlobalConsensus::::contains(&asset, &origin)); -} - -#[test] -fn test_from_ethereum_global_consensus_without_containing_asset_yields_false() { - let origin = MultiLocation { parents: 2, interior: X1(GlobalConsensus(NETWORK)) }; - let asset = - MultiLocation { parents: 2, interior: X2(GlobalConsensus(Polkadot), Parachain(1000)) }; - assert!(!FromEthereumGlobalConsensus::::contains(&asset, &origin)); -} - -#[test] -fn test_from_ethereum_global_consensus_without_bridge_origin_yields_false() { - let origin = - MultiLocation { parents: 2, interior: X2(GlobalConsensus(Polkadot), Parachain(1000)) }; - let asset = MultiLocation { - parents: 2, - interior: X2(GlobalConsensus(NETWORK), AccountKey20 { network: None, key: [0; 20] }), - }; - assert!(!FromEthereumGlobalConsensus::::contains(&asset, &origin)); -} diff --git a/polkadot-sdk b/polkadot-sdk index 6a3b064f5c..67e87185be 160000 --- a/polkadot-sdk +++ b/polkadot-sdk @@ -1 +1 @@ -Subproject commit 6a3b064f5cdeb33e3452cb162f5dfbac960e0ff3 +Subproject commit 67e87185be5a41990c6d8325d2e617e669c7cb5f