mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 21:01:02 +00:00
[xcm-builder] Replaced deprecated CurrencyAdapter with FungibleAdapter (#3287)
I found out during the cleanup of this deprecation message in the `polkadot-fellows` repository that we deprecated `CurrencyAdapter` without making the recommended changes. ## TODO - [ ] fix `polkadot-fellows` bump to 1.6.0 https://github.com/polkadot-fellows/runtimes/pull/159 --------- Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
This commit is contained in:
@@ -188,6 +188,7 @@ pub fn send_transfer_token_message_success<Runtime, XcmConfig>(
|
||||
let channel_id: ChannelId = origin.into();
|
||||
|
||||
let nonce = snowbridge_pallet_outbound_queue::Nonce::<Runtime>::try_get(channel_id);
|
||||
dbg!(&nonce);
|
||||
assert_ok!(nonce);
|
||||
assert_eq!(nonce.unwrap(), 1);
|
||||
|
||||
|
||||
@@ -30,10 +30,9 @@ use sp_runtime::{
|
||||
BuildStorage,
|
||||
};
|
||||
use xcm::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
FixedWeightBounds, FrameTransactionalProcessor, IsConcrete, NativeAsset, ParentIsPreset,
|
||||
FixedWeightBounds, FrameTransactionalProcessor, FungibleAdapter, IsConcrete, NativeAsset,
|
||||
ParentIsPreset,
|
||||
};
|
||||
use xcm_executor::traits::ConvertOrigin;
|
||||
|
||||
@@ -133,8 +132,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
/// Means for transacting assets on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type LocalAssetTransactor = CurrencyAdapter<
|
||||
pub type LocalAssetTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
|
||||
@@ -12,15 +12,13 @@ use pallet_xcm::XcmPassthrough;
|
||||
use polkadot_parachain_primitives::primitives::Sibling;
|
||||
use polkadot_runtime_common::impls::ToAuthor;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom,
|
||||
DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, FixedWeightBounds,
|
||||
FrameTransactionalProcessor, IsConcrete, NativeAsset, ParentIsPreset, RelayChainAsNative,
|
||||
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
|
||||
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId,
|
||||
UsingComponents, WithComputedOrigin, WithUniqueTopic,
|
||||
FrameTransactionalProcessor, FungibleAdapter, IsConcrete, NativeAsset, ParentIsPreset,
|
||||
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
||||
TrailingSetTopicAsId, UsingComponents, WithComputedOrigin, WithUniqueTopic,
|
||||
};
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
@@ -44,8 +42,7 @@ pub type LocationToAccountId = (
|
||||
);
|
||||
|
||||
/// Means for transacting assets on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type LocalAssetTransactor = CurrencyAdapter<
|
||||
pub type LocalAssetTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
|
||||
@@ -76,7 +76,7 @@ macro_rules! test_parachain_is_trusted_teleporter {
|
||||
$crate::macros::cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }
|
||||
) => {},
|
||||
RuntimeEvent::Balances(
|
||||
$crate::macros::pallet_balances::Event::Withdraw { who: sender, amount }
|
||||
$crate::macros::pallet_balances::Event::Burned { who: sender, amount }
|
||||
) => {},
|
||||
]
|
||||
);
|
||||
@@ -90,7 +90,7 @@ macro_rules! test_parachain_is_trusted_teleporter {
|
||||
$receiver_para,
|
||||
vec![
|
||||
RuntimeEvent::Balances(
|
||||
$crate::macros::pallet_balances::Event::Deposit { who: receiver, .. }
|
||||
$crate::macros::pallet_balances::Event::Minted { who: receiver, .. }
|
||||
) => {},
|
||||
RuntimeEvent::MessageQueue(
|
||||
$crate::macros::pallet_message_queue::Event::Processed { success: true, .. }
|
||||
|
||||
+9
-9
@@ -66,7 +66,7 @@ fn para_receiver_assertions<Test>(_: Test) {
|
||||
assert_expected_events!(
|
||||
PenpalA,
|
||||
vec![
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {},
|
||||
RuntimeEvent::MessageQueue(
|
||||
pallet_message_queue::Event::Processed { success: true, .. }
|
||||
) => {},
|
||||
@@ -82,7 +82,7 @@ fn para_to_system_para_sender_assertions(t: ParaToSystemParaTest) {
|
||||
vec![
|
||||
// Amount to reserve transfer is transferred to Parachain's Sovereign account
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
@@ -101,12 +101,12 @@ fn para_to_system_para_receiver_assertions(t: ParaToSystemParaTest) {
|
||||
vec![
|
||||
// Amount to reserve transfer is withdrawn from Parachain's Sovereign account
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == sov_penpal_on_ahr.clone().into(),
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {},
|
||||
RuntimeEvent::MessageQueue(
|
||||
pallet_message_queue::Event::Processed { success: true, .. }
|
||||
) => {},
|
||||
@@ -143,7 +143,7 @@ fn system_para_to_para_assets_receiver_assertions<Test>(_: Test) {
|
||||
assert_expected_events!(
|
||||
PenpalA,
|
||||
vec![
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {},
|
||||
RuntimeEvent::Assets(pallet_assets::Event::Issued { .. }) => {},
|
||||
RuntimeEvent::MessageQueue(
|
||||
pallet_message_queue::Event::Processed { success: true, .. }
|
||||
@@ -160,7 +160,7 @@ fn para_to_para_sender_assertions(t: ParaToParaTest) {
|
||||
vec![
|
||||
// Amount to reserve transfer is transferred to Parachain's Sovereign account
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
@@ -184,14 +184,14 @@ fn para_to_para_relay_hop_assertions(t: ParaToParaTest) {
|
||||
vec![
|
||||
// Withdrawn from sender parachain SA
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == sov_penpal_a_on_rococo,
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
// Deposited to receiver parachain SA
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Deposit { who, .. }
|
||||
pallet_balances::Event::Minted { who, .. }
|
||||
) => {
|
||||
who: *who == sov_penpal_b_on_rococo,
|
||||
},
|
||||
@@ -207,7 +207,7 @@ fn para_to_para_receiver_assertions(_: ParaToParaTest) {
|
||||
assert_expected_events!(
|
||||
PenpalB,
|
||||
vec![
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {},
|
||||
RuntimeEvent::MessageQueue(
|
||||
pallet_message_queue::Event::Processed { success: true, .. }
|
||||
) => {},
|
||||
|
||||
+10
-10
@@ -28,12 +28,12 @@ fn relay_origin_assertions(t: RelayToSystemParaTest) {
|
||||
Rococo,
|
||||
vec![
|
||||
// Amount to teleport is withdrawn from Sender
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
// Amount to teleport is deposited in Relay's `CheckAccount`
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, amount }) => {
|
||||
who: *who == <Rococo as RococoPallet>::XcmPallet::check_account(),
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
@@ -54,12 +54,12 @@ fn relay_dest_assertions(t: SystemParaToRelayTest) {
|
||||
Rococo,
|
||||
vec![
|
||||
// Amount is withdrawn from Relay Chain's `CheckAccount`
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
|
||||
who: *who == <Rococo as RococoPallet>::XcmPallet::check_account(),
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
// Amount minus fees are deposited in Receiver's account
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == t.receiver.account_id,
|
||||
},
|
||||
]
|
||||
@@ -88,7 +88,7 @@ fn para_origin_assertions(t: SystemParaToRelayTest) {
|
||||
AssetHubRococo,
|
||||
vec![
|
||||
// Amount is withdrawn from Sender's account
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
@@ -105,7 +105,7 @@ fn para_dest_assertions(t: RelayToSystemParaTest) {
|
||||
AssetHubRococo,
|
||||
vec![
|
||||
// Amount minus fees are deposited in Receiver's account
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == t.receiver.account_id,
|
||||
},
|
||||
]
|
||||
@@ -122,7 +122,7 @@ fn penpal_to_ah_foreign_assets_sender_assertions(t: ParaToSystemParaTest) {
|
||||
PenpalA,
|
||||
vec![
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
@@ -149,12 +149,12 @@ fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) {
|
||||
vec![
|
||||
// native asset reserve transfer for paying fees, withdrawn from Penpal's sov account
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == sov_penpal_on_ahr.clone().into(),
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == t.receiver.account_id,
|
||||
},
|
||||
RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, amount }) => {
|
||||
@@ -221,7 +221,7 @@ fn ah_to_penpal_foreign_assets_receiver_assertions(t: SystemParaToParaTest) {
|
||||
amount: *amount == expected_asset_amount,
|
||||
},
|
||||
// native asset for fee is deposited to receiver
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == t.receiver.account_id,
|
||||
},
|
||||
RuntimeEvent::MessageQueue(
|
||||
|
||||
+9
-9
@@ -70,7 +70,7 @@ fn para_receiver_assertions<Test>(_: Test) {
|
||||
assert_expected_events!(
|
||||
PenpalB,
|
||||
vec![
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {},
|
||||
RuntimeEvent::MessageQueue(
|
||||
pallet_message_queue::Event::Processed { success: true, .. }
|
||||
) => {},
|
||||
@@ -88,7 +88,7 @@ fn para_to_system_para_sender_assertions(t: ParaToSystemParaTest) {
|
||||
vec![
|
||||
// Amount to reserve transfer is transferred to Parachain's Sovereign account
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
@@ -109,12 +109,12 @@ fn para_to_system_para_receiver_assertions(t: ParaToSystemParaTest) {
|
||||
vec![
|
||||
// Amount to reserve transfer is transferred to Parachain's Sovereign account
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == sov_penpal_on_ahw.clone().into(),
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {},
|
||||
RuntimeEvent::MessageQueue(
|
||||
pallet_message_queue::Event::Processed { success: true, .. }
|
||||
) => {},
|
||||
@@ -153,7 +153,7 @@ fn system_para_to_para_assets_receiver_assertions<Test>(_: Test) {
|
||||
assert_expected_events!(
|
||||
PenpalB,
|
||||
vec![
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {},
|
||||
RuntimeEvent::Assets(pallet_assets::Event::Issued { .. }) => {},
|
||||
RuntimeEvent::MessageQueue(
|
||||
pallet_message_queue::Event::Processed { success: true, .. }
|
||||
@@ -170,7 +170,7 @@ fn para_to_para_sender_assertions(t: ParaToParaTest) {
|
||||
vec![
|
||||
// Amount to reserve transfer is transferred to Parachain's Sovereign account
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
@@ -194,14 +194,14 @@ fn para_to_para_relay_hop_assertions(t: ParaToParaTest) {
|
||||
vec![
|
||||
// Withdrawn from sender parachain SA
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == sov_penpal_b_on_westend,
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
// Deposited to receiver parachain SA
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Deposit { who, .. }
|
||||
pallet_balances::Event::Minted { who, .. }
|
||||
) => {
|
||||
who: *who == sov_penpal_a_on_westend,
|
||||
},
|
||||
@@ -217,7 +217,7 @@ fn para_to_para_receiver_assertions(_: ParaToParaTest) {
|
||||
assert_expected_events!(
|
||||
PenpalA,
|
||||
vec![
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {},
|
||||
RuntimeEvent::MessageQueue(
|
||||
pallet_message_queue::Event::Processed { success: true, .. }
|
||||
) => {},
|
||||
|
||||
+10
-10
@@ -28,12 +28,12 @@ fn relay_origin_assertions(t: RelayToSystemParaTest) {
|
||||
Westend,
|
||||
vec![
|
||||
// Amount to teleport is withdrawn from Sender
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
// Amount to teleport is deposited in Relay's `CheckAccount`
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, amount }) => {
|
||||
who: *who == <Westend as WestendPallet>::XcmPallet::check_account(),
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
@@ -54,12 +54,12 @@ fn relay_dest_assertions(t: SystemParaToRelayTest) {
|
||||
Westend,
|
||||
vec![
|
||||
// Amount is withdrawn from Relay Chain's `CheckAccount`
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
|
||||
who: *who == <Westend as WestendPallet>::XcmPallet::check_account(),
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
// Amount minus fees are deposited in Receiver's account
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == t.receiver.account_id,
|
||||
},
|
||||
]
|
||||
@@ -88,7 +88,7 @@ fn para_origin_assertions(t: SystemParaToRelayTest) {
|
||||
AssetHubWestend,
|
||||
vec![
|
||||
// Amount is withdrawn from Sender's account
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
@@ -105,7 +105,7 @@ fn para_dest_assertions(t: RelayToSystemParaTest) {
|
||||
AssetHubWestend,
|
||||
vec![
|
||||
// Amount minus fees are deposited in Receiver's account
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == t.receiver.account_id,
|
||||
},
|
||||
]
|
||||
@@ -122,7 +122,7 @@ fn penpal_to_ah_foreign_assets_sender_assertions(t: ParaToSystemParaTest) {
|
||||
PenpalB,
|
||||
vec![
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
@@ -149,12 +149,12 @@ fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) {
|
||||
vec![
|
||||
// native asset reserve transfer for paying fees, withdrawn from Penpal's sov account
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == sov_penpal_on_ahr.clone().into(),
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == t.receiver.account_id,
|
||||
},
|
||||
RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, amount }) => {
|
||||
@@ -221,7 +221,7 @@ fn ah_to_penpal_foreign_assets_receiver_assertions(t: SystemParaToParaTest) {
|
||||
amount: *amount == expected_asset_amount,
|
||||
},
|
||||
// native asset for fee is deposited to receiver
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == t.receiver.account_id,
|
||||
},
|
||||
RuntimeEvent::MessageQueue(
|
||||
|
||||
+2
-2
@@ -184,13 +184,13 @@ fn send_wnds_from_asset_hub_rococo_to_asset_hub_westend() {
|
||||
vec![
|
||||
// WND is withdrawn from AHR's SA on AHW
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == sov_ahr_on_ahw,
|
||||
amount: *amount == amount_to_send,
|
||||
},
|
||||
// WNDs deposited to beneficiary
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == AssetHubWestendReceiver::get(),
|
||||
},
|
||||
// message processed successfully
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ pub(crate) fn assert_bridge_hub_rococo_message_accepted(expected_processed: bool
|
||||
BridgeHubRococo,
|
||||
vec![
|
||||
// pay for bridge fees
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { .. }) => {},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { .. }) => {},
|
||||
// message exported
|
||||
RuntimeEvent::BridgeWestendMessages(
|
||||
pallet_bridge_messages::Event::MessageAccepted { .. }
|
||||
|
||||
+2
-2
@@ -478,7 +478,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() {
|
||||
assert!(
|
||||
events.iter().any(|event| matches!(
|
||||
event,
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit{ who, amount })
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, amount })
|
||||
if *who == TREASURY_ACCOUNT.into() && *amount == 16903333
|
||||
)),
|
||||
"Snowbridge sovereign takes local fee."
|
||||
@@ -487,7 +487,7 @@ fn send_weth_asset_from_asset_hub_to_ethereum() {
|
||||
assert!(
|
||||
events.iter().any(|event| matches!(
|
||||
event,
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit{ who, amount })
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, amount })
|
||||
if *who == assethub_sovereign && *amount == 2680000000000,
|
||||
)),
|
||||
"AssetHub sovereign takes remote fee."
|
||||
|
||||
+2
-2
@@ -182,13 +182,13 @@ fn send_rocs_from_asset_hub_westend_to_asset_hub_rococo() {
|
||||
vec![
|
||||
// ROC is withdrawn from AHW's SA on AHR
|
||||
RuntimeEvent::Balances(
|
||||
pallet_balances::Event::Withdraw { who, amount }
|
||||
pallet_balances::Event::Burned { who, amount }
|
||||
) => {
|
||||
who: *who == sov_ahw_on_ahr,
|
||||
amount: *amount == amount_to_send,
|
||||
},
|
||||
// ROCs deposited to beneficiary
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == AssetHubRococoReceiver::get(),
|
||||
},
|
||||
// message processed successfully
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ pub(crate) fn assert_bridge_hub_westend_message_accepted(expected_processed: boo
|
||||
BridgeHubWestend,
|
||||
vec![
|
||||
// pay for bridge fees
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { .. }) => {},
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { .. }) => {},
|
||||
// message exported
|
||||
RuntimeEvent::BridgeRococoMessages(
|
||||
pallet_bridge_messages::Event::MessageAccepted { .. }
|
||||
|
||||
+2
-2
@@ -366,7 +366,7 @@ fn assert_reap_events(id_deposit: Balance, id: &Identity) {
|
||||
PeopleRococo,
|
||||
vec![
|
||||
// Deposit and Endowed from teleport
|
||||
RuntimeEvent::Balances(BalancesEvent::Deposit { .. }) => {},
|
||||
RuntimeEvent::Balances(BalancesEvent::Minted { .. }) => {},
|
||||
RuntimeEvent::Balances(BalancesEvent::Endowed { .. }) => {},
|
||||
// Amount reserved for identity info
|
||||
RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
|
||||
@@ -392,7 +392,7 @@ fn assert_reap_events(id_deposit: Balance, id: &Identity) {
|
||||
PeopleRococo,
|
||||
vec![
|
||||
// Deposit and Endowed from teleport
|
||||
RuntimeEvent::Balances(BalancesEvent::Deposit { .. }) => {},
|
||||
RuntimeEvent::Balances(BalancesEvent::Minted { .. }) => {},
|
||||
RuntimeEvent::Balances(BalancesEvent::Endowed { .. }) => {},
|
||||
// Amount reserved for identity info
|
||||
RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
|
||||
|
||||
+6
-6
@@ -25,12 +25,12 @@ fn relay_origin_assertions(t: RelayToSystemParaTest) {
|
||||
Rococo,
|
||||
vec![
|
||||
// Amount to teleport is withdrawn from Sender
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
// Amount to teleport is deposited in Relay's `CheckAccount`
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, amount }) => {
|
||||
who: *who == <Rococo as RococoPallet>::XcmPallet::check_account(),
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
@@ -51,12 +51,12 @@ fn relay_dest_assertions(t: SystemParaToRelayTest) {
|
||||
Rococo,
|
||||
vec![
|
||||
// Amount is withdrawn from Relay Chain's `CheckAccount`
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
|
||||
who: *who == <Rococo as RococoPallet>::XcmPallet::check_account(),
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
// Amount minus fees are deposited in Receiver's account
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == t.receiver.account_id,
|
||||
},
|
||||
]
|
||||
@@ -85,7 +85,7 @@ fn para_origin_assertions(t: SystemParaToRelayTest) {
|
||||
PeopleRococo,
|
||||
vec![
|
||||
// Amount is withdrawn from Sender's account
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
@@ -102,7 +102,7 @@ fn para_dest_assertions(t: RelayToSystemParaTest) {
|
||||
PeopleRococo,
|
||||
vec![
|
||||
// Amount minus fees are deposited in Receiver's account
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == t.receiver.account_id,
|
||||
},
|
||||
]
|
||||
|
||||
+2
-2
@@ -368,7 +368,7 @@ fn assert_reap_events(id_deposit: Balance, id: &Identity) {
|
||||
PeopleWestend,
|
||||
vec![
|
||||
// Deposit and Endowed from teleport
|
||||
RuntimeEvent::Balances(BalancesEvent::Deposit { .. }) => {},
|
||||
RuntimeEvent::Balances(BalancesEvent::Minted { .. }) => {},
|
||||
RuntimeEvent::Balances(BalancesEvent::Endowed { .. }) => {},
|
||||
// Amount reserved for identity info
|
||||
RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
|
||||
@@ -394,7 +394,7 @@ fn assert_reap_events(id_deposit: Balance, id: &Identity) {
|
||||
PeopleWestend,
|
||||
vec![
|
||||
// Deposit and Endowed from teleport
|
||||
RuntimeEvent::Balances(BalancesEvent::Deposit { .. }) => {},
|
||||
RuntimeEvent::Balances(BalancesEvent::Minted { .. }) => {},
|
||||
RuntimeEvent::Balances(BalancesEvent::Endowed { .. }) => {},
|
||||
// Amount reserved for identity info
|
||||
RuntimeEvent::Balances(BalancesEvent::Reserved { who, amount }) => {
|
||||
|
||||
+6
-6
@@ -25,12 +25,12 @@ fn relay_origin_assertions(t: RelayToSystemParaTest) {
|
||||
Westend,
|
||||
vec![
|
||||
// Amount to teleport is withdrawn from Sender
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
// Amount to teleport is deposited in Relay's `CheckAccount`
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, amount }) => {
|
||||
who: *who == <Westend as WestendPallet>::XcmPallet::check_account(),
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
@@ -51,12 +51,12 @@ fn relay_dest_assertions(t: SystemParaToRelayTest) {
|
||||
Westend,
|
||||
vec![
|
||||
// Amount is withdrawn from Relay Chain's `CheckAccount`
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
|
||||
who: *who == <Westend as WestendPallet>::XcmPallet::check_account(),
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
// Amount minus fees are deposited in Receiver's account
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == t.receiver.account_id,
|
||||
},
|
||||
]
|
||||
@@ -85,7 +85,7 @@ fn para_origin_assertions(t: SystemParaToRelayTest) {
|
||||
PeopleWestend,
|
||||
vec![
|
||||
// Amount is withdrawn from Sender's account
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Withdraw { who, amount }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => {
|
||||
who: *who == t.sender.account_id,
|
||||
amount: *amount == t.args.amount,
|
||||
},
|
||||
@@ -102,7 +102,7 @@ fn para_dest_assertions(t: RelayToSystemParaTest) {
|
||||
PeopleWestend,
|
||||
vec![
|
||||
// Amount minus fees are deposited in Receiver's account
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => {
|
||||
who: *who == t.receiver.account_id,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -49,19 +49,18 @@ use testnet_parachains_constants::rococo::snowbridge::{
|
||||
EthereumNetwork, INBOUND_QUEUE_PALLET_INDEX,
|
||||
};
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
|
||||
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyReserveTransferToRelayChain,
|
||||
DenyThenTry, DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, FrameTransactionalProcessor,
|
||||
FungiblesAdapter, GlobalConsensusParachainConvertsFor, HashedDescription, IsConcrete,
|
||||
LocalMint, NetworkExportTableItem, NoChecking, NonFungiblesAdapter, ParentAsSuperuser,
|
||||
ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignPaidRemoteExporter,
|
||||
SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus, TakeWeightCredit,
|
||||
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
FungibleAdapter, FungiblesAdapter, GlobalConsensusParachainConvertsFor, HashedDescription,
|
||||
IsConcrete, LocalMint, NetworkExportTableItem, NoChecking, NonFungiblesAdapter,
|
||||
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
|
||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignPaidRemoteExporter, SovereignSignedViaLocation, StartsWith,
|
||||
StartsWithExplicitGlobalConsensus, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
|
||||
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
|
||||
XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
|
||||
@@ -114,8 +113,7 @@ pub type LocationToAccountId = (
|
||||
);
|
||||
|
||||
/// Means for transacting the native currency on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type CurrencyTransactor = CurrencyAdapter<
|
||||
pub type FungibleTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
@@ -223,7 +221,7 @@ pub type PoolFungiblesTransactor = FungiblesAdapter<
|
||||
|
||||
/// Means for transacting assets on this chain.
|
||||
pub type AssetTransactors = (
|
||||
CurrencyTransactor,
|
||||
FungibleTransactor,
|
||||
FungiblesTransactor,
|
||||
ForeignFungiblesTransactor,
|
||||
PoolFungiblesTransactor,
|
||||
|
||||
@@ -45,19 +45,18 @@ use polkadot_parachain_primitives::primitives::Sibling;
|
||||
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use sp_runtime::traits::{AccountIdConversion, ConvertInto};
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
|
||||
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyReserveTransferToRelayChain,
|
||||
DenyThenTry, DescribeFamily, DescribePalletTerminal, EnsureXcmOrigin,
|
||||
FrameTransactionalProcessor, FungiblesAdapter, GlobalConsensusParachainConvertsFor,
|
||||
HashedDescription, IsConcrete, LocalMint, NetworkExportTableItem, NoChecking,
|
||||
NonFungiblesAdapter, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
|
||||
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
|
||||
SignedToAccountId32, SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus,
|
||||
TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin,
|
||||
WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
FrameTransactionalProcessor, FungibleAdapter, FungiblesAdapter,
|
||||
GlobalConsensusParachainConvertsFor, HashedDescription, IsConcrete, LocalMint,
|
||||
NetworkExportTableItem, NoChecking, NonFungiblesAdapter, ParentAsSuperuser, ParentIsPreset,
|
||||
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, StartsWith,
|
||||
StartsWithExplicitGlobalConsensus, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
|
||||
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
|
||||
XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
|
||||
@@ -107,8 +106,7 @@ pub type LocationToAccountId = (
|
||||
);
|
||||
|
||||
/// Means for transacting the native currency on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type CurrencyTransactor = CurrencyAdapter<
|
||||
pub type FungibleTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
@@ -216,7 +214,7 @@ pub type PoolFungiblesTransactor = FungiblesAdapter<
|
||||
|
||||
/// Means for transacting assets on this chain.
|
||||
pub type AssetTransactors = (
|
||||
CurrencyTransactor,
|
||||
FungibleTransactor,
|
||||
FungiblesTransactor,
|
||||
ForeignFungiblesTransactor,
|
||||
PoolFungiblesTransactor,
|
||||
|
||||
@@ -54,16 +54,14 @@ use sp_runtime::traits::AccountIdConversion;
|
||||
use sp_std::marker::PhantomData;
|
||||
use testnet_parachains_constants::rococo::snowbridge::EthereumNetwork;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::{
|
||||
deposit_or_burn_fee, AccountId32Aliases, AllowExplicitUnpaidExecutionFrom,
|
||||
AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom,
|
||||
CurrencyAdapter, DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin,
|
||||
FrameTransactionalProcessor, HandleFee, IsConcrete, ParentAsSuperuser, ParentIsPreset,
|
||||
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
||||
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeToAccount,
|
||||
DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, FrameTransactionalProcessor,
|
||||
FungibleAdapter, HandleFee, IsConcrete, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
|
||||
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
|
||||
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId,
|
||||
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{
|
||||
traits::{FeeManager, FeeReason, FeeReason::Export, TransactAsset, WithOriginFilter},
|
||||
@@ -96,8 +94,7 @@ pub type LocationToAccountId = (
|
||||
);
|
||||
|
||||
/// Means for transacting the native currency on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type CurrencyTransactor = CurrencyAdapter<
|
||||
pub type FungibleTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
@@ -285,7 +282,7 @@ pub struct XcmConfig;
|
||||
impl xcm_executor::Config for XcmConfig {
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type XcmSender = XcmRouter;
|
||||
type AssetTransactor = CurrencyTransactor;
|
||||
type AssetTransactor = FungibleTransactor;
|
||||
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||
// BridgeHub does not recognize a reserve location for any asset. Users must teleport Native
|
||||
// token where allowed (e.g. with the Relay Chain).
|
||||
|
||||
@@ -102,7 +102,7 @@ pub fn transfer_token_to_ethereum_insufficient_fund() {
|
||||
H160::random(),
|
||||
H160::random(),
|
||||
DefaultBridgeHubEthereumBaseFee::get(),
|
||||
FailedToTransactAsset("InsufficientBalance"),
|
||||
FailedToTransactAsset("Funds are unavailable"),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -38,16 +38,15 @@ use polkadot_parachain_primitives::primitives::Sibling;
|
||||
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use sp_runtime::traits::AccountIdConversion;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
|
||||
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyReserveTransferToRelayChain,
|
||||
DenyThenTry, EnsureXcmOrigin, FrameTransactionalProcessor, IsConcrete, ParentAsSuperuser,
|
||||
ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
||||
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
DenyThenTry, EnsureXcmOrigin, FrameTransactionalProcessor, FungibleAdapter, IsConcrete,
|
||||
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
|
||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
|
||||
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
|
||||
XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
|
||||
@@ -76,8 +75,7 @@ pub type LocationToAccountId = (
|
||||
);
|
||||
|
||||
/// Means for transacting the native currency on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type CurrencyTransactor = CurrencyAdapter<
|
||||
pub type FungibleTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
@@ -233,7 +231,7 @@ pub struct XcmConfig;
|
||||
impl xcm_executor::Config for XcmConfig {
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type XcmSender = XcmRouter;
|
||||
type AssetTransactor = CurrencyTransactor;
|
||||
type AssetTransactor = FungibleTransactor;
|
||||
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||
// BridgeHub does not recognize a reserve location for any asset. Users must teleport Native
|
||||
// token where allowed (e.g. with the Relay Chain).
|
||||
|
||||
@@ -36,13 +36,11 @@ use polkadot_parachain_primitives::primitives::Sibling;
|
||||
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use westend_runtime_constants::xcm as xcm_constants;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
|
||||
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyReserveTransferToRelayChain,
|
||||
DenyThenTry, EnsureXcmOrigin, FixedWeightBounds, FrameTransactionalProcessor, IsConcrete,
|
||||
LocatableAssetId, OriginToPluralityVoice, ParentAsSuperuser, ParentIsPreset,
|
||||
DenyThenTry, EnsureXcmOrigin, FixedWeightBounds, FrameTransactionalProcessor, FungibleAdapter,
|
||||
IsConcrete, LocatableAssetId, OriginToPluralityVoice, ParentAsSuperuser, ParentIsPreset,
|
||||
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
||||
TrailingSetTopicAsId, UsingComponents, WithComputedOrigin, WithUniqueTopic,
|
||||
@@ -85,9 +83,8 @@ pub type LocationToAccountId = (
|
||||
AccountId32Aliases<RelayNetwork, AccountId>,
|
||||
);
|
||||
|
||||
/// Means for transacting the native currency on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type CurrencyTransactor = CurrencyAdapter<
|
||||
/// Means for transacting the native currency on this chain.#[allow(deprecated)]
|
||||
pub type FungibleTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
@@ -262,7 +259,7 @@ pub struct XcmConfig;
|
||||
impl xcm_executor::Config for XcmConfig {
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type XcmSender = XcmRouter;
|
||||
type AssetTransactor = CurrencyTransactor;
|
||||
type AssetTransactor = FungibleTransactor;
|
||||
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||
// Collectives does not recognize a reserve location for any asset. Users must teleport WND
|
||||
// where allowed (e.g. with the Relay Chain).
|
||||
|
||||
@@ -37,16 +37,15 @@ use polkadot_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use sp_runtime::traits::AccountIdConversion;
|
||||
use testnet_parachains_constants::rococo::currency::CENTS;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
|
||||
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyReserveTransferToRelayChain,
|
||||
DenyThenTry, EnsureXcmOrigin, FixedWeightBounds, FrameTransactionalProcessor, IsConcrete,
|
||||
NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
|
||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
|
||||
WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
DenyThenTry, EnsureXcmOrigin, FixedWeightBounds, FrameTransactionalProcessor, FungibleAdapter,
|
||||
IsConcrete, NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
|
||||
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
|
||||
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId,
|
||||
UsingComponents, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
|
||||
XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
@@ -79,8 +78,7 @@ pub type LocationToAccountId = (
|
||||
);
|
||||
|
||||
/// Means for transacting the native currency on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type CurrencyTransactor = CurrencyAdapter<
|
||||
pub type CurrencyTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
|
||||
@@ -38,17 +38,15 @@ use polkadot_parachain_primitives::primitives::Sibling;
|
||||
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use sp_runtime::traits::AccountIdConversion;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
|
||||
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyReserveTransferToRelayChain,
|
||||
DenyThenTry, EnsureXcmOrigin, FrameTransactionalProcessor, IsConcrete, NonFungibleAdapter,
|
||||
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
|
||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
|
||||
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
|
||||
XcmFeeToAccount,
|
||||
DenyThenTry, EnsureXcmOrigin, FrameTransactionalProcessor, FungibleAdapter, IsConcrete,
|
||||
NonFungibleAdapter, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
|
||||
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
|
||||
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId,
|
||||
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
|
||||
@@ -79,8 +77,7 @@ pub type LocationToAccountId = (
|
||||
);
|
||||
|
||||
/// Means for transacting the native currency on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type CurrencyTransactor = CurrencyAdapter<
|
||||
pub type CurrencyTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
|
||||
@@ -37,16 +37,15 @@ use polkadot_parachain_primitives::primitives::Sibling;
|
||||
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use sp_runtime::traits::AccountIdConversion;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
|
||||
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyReserveTransferToRelayChain,
|
||||
DenyThenTry, EnsureXcmOrigin, FrameTransactionalProcessor, IsConcrete, ParentAsSuperuser,
|
||||
ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
||||
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
DenyThenTry, EnsureXcmOrigin, FrameTransactionalProcessor, FungibleAdapter, IsConcrete,
|
||||
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
|
||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
|
||||
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
|
||||
XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
|
||||
@@ -75,8 +74,7 @@ pub type LocationToAccountId = (
|
||||
);
|
||||
|
||||
/// Means for transacting the native currency on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type CurrencyTransactor = CurrencyAdapter<
|
||||
pub type CurrencyTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
|
||||
@@ -34,17 +34,15 @@ use parachains_common::{
|
||||
use polkadot_parachain_primitives::primitives::Sibling;
|
||||
use sp_runtime::traits::AccountIdConversion;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
|
||||
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyReserveTransferToRelayChain,
|
||||
DenyThenTry, DescribeTerminus, EnsureXcmOrigin, FrameTransactionalProcessor, HashedDescription,
|
||||
IsConcrete, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
|
||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
|
||||
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
|
||||
XcmFeeToAccount,
|
||||
DenyThenTry, DescribeTerminus, EnsureXcmOrigin, FrameTransactionalProcessor, FungibleAdapter,
|
||||
HashedDescription, IsConcrete, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
|
||||
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
|
||||
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId,
|
||||
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
|
||||
@@ -97,8 +95,7 @@ pub type LocationToAccountId = (
|
||||
);
|
||||
|
||||
/// Means for transacting the native currency on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type CurrencyTransactor = CurrencyAdapter<
|
||||
pub type FungibleTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
@@ -244,7 +241,7 @@ pub struct XcmConfig;
|
||||
impl xcm_executor::Config for XcmConfig {
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type XcmSender = XcmRouter;
|
||||
type AssetTransactor = CurrencyTransactor;
|
||||
type AssetTransactor = FungibleTransactor;
|
||||
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||
// People chain does not recognize a reserve location for any asset. Users must teleport ROC
|
||||
// where allowed (e.g. with the Relay Chain).
|
||||
|
||||
@@ -34,17 +34,15 @@ use parachains_common::{
|
||||
use polkadot_parachain_primitives::primitives::Sibling;
|
||||
use sp_runtime::traits::AccountIdConversion;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
|
||||
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DenyReserveTransferToRelayChain,
|
||||
DenyThenTry, DescribeTerminus, EnsureXcmOrigin, FrameTransactionalProcessor, HashedDescription,
|
||||
IsConcrete, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
|
||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
|
||||
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
|
||||
XcmFeeToAccount,
|
||||
DenyThenTry, DescribeTerminus, EnsureXcmOrigin, FrameTransactionalProcessor, FungibleAdapter,
|
||||
HashedDescription, IsConcrete, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
|
||||
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
|
||||
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId,
|
||||
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
|
||||
@@ -97,8 +95,7 @@ pub type LocationToAccountId = (
|
||||
);
|
||||
|
||||
/// Means for transacting the native currency on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type CurrencyTransactor = CurrencyAdapter<
|
||||
pub type FungibleTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
@@ -252,7 +249,7 @@ pub struct XcmConfig;
|
||||
impl xcm_executor::Config for XcmConfig {
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type XcmSender = XcmRouter;
|
||||
type AssetTransactor = CurrencyTransactor;
|
||||
type AssetTransactor = FungibleTransactor;
|
||||
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||
// People does not recognize a reserve location for any asset. Users must teleport WND
|
||||
// where allowed (e.g. with the Relay Chain).
|
||||
|
||||
@@ -45,12 +45,11 @@ use polkadot_runtime_common::impls::ToAuthor;
|
||||
use sp_runtime::traits::Zero;
|
||||
use testnet_parachains_constants::rococo::snowbridge::EthereumNetwork;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
|
||||
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex,
|
||||
ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
|
||||
FrameTransactionalProcessor, FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, NoChecking,
|
||||
ConvertedConcreteId, EnsureXcmOrigin, FixedWeightBounds, FrameTransactionalProcessor,
|
||||
FungibleAdapter, FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, NoChecking,
|
||||
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
|
||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, StartsWith, TakeWeightCredit, TrailingSetTopicAsId,
|
||||
@@ -78,8 +77,7 @@ pub type LocationToAccountId = (
|
||||
);
|
||||
|
||||
/// Means for transacting assets on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type CurrencyTransactor = CurrencyAdapter<
|
||||
pub type CurrencyTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
|
||||
@@ -84,14 +84,12 @@ use xcm_executor::traits::JustTry;
|
||||
use pallet_xcm::{EnsureXcm, IsMajorityOfBody, XcmPassthrough};
|
||||
use polkadot_parachain_primitives::primitives::Sibling;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom,
|
||||
EnsureXcmOrigin, FixedWeightBounds, IsConcrete, NativeAsset, ParentAsSuperuser, ParentIsPreset,
|
||||
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
||||
UsingComponents,
|
||||
EnsureXcmOrigin, FixedWeightBounds, FungibleAdapter, IsConcrete, NativeAsset,
|
||||
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
|
||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
|
||||
};
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
@@ -350,8 +348,7 @@ pub type LocationToAccountId = (
|
||||
);
|
||||
|
||||
/// Means for transacting assets on this chain.
|
||||
#[allow(deprecated)]
|
||||
pub type CurrencyTransactor = CurrencyAdapter<
|
||||
pub type CurrencyTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
|
||||
@@ -36,17 +36,15 @@ use runtime_common::{
|
||||
};
|
||||
use sp_core::ConstU32;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter as XcmCurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
|
||||
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative,
|
||||
ChildParachainConvertsVia, DescribeBodyTerminal, DescribeFamily, FixedWeightBounds,
|
||||
FrameTransactionalProcessor, HashedDescription, IsChildSystemParachain, IsConcrete,
|
||||
MintLocation, OriginToPluralityVoice, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
|
||||
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
|
||||
XcmFeeToAccount,
|
||||
FrameTransactionalProcessor, FungibleAdapter, HashedDescription, IsChildSystemParachain,
|
||||
IsConcrete, MintLocation, OriginToPluralityVoice, SignedAccountId32AsNative,
|
||||
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId,
|
||||
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
@@ -73,8 +71,7 @@ pub type LocationConverter = (
|
||||
/// point of view of XCM-only concepts like `Location` and `Asset`.
|
||||
///
|
||||
/// Ours is only aware of the Balances pallet, which is mapped to `RocLocation`.
|
||||
#[allow(deprecated)]
|
||||
pub type LocalAssetTransactor = XcmCurrencyAdapter<
|
||||
pub type LocalAssetTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
|
||||
@@ -39,15 +39,13 @@ use westend_runtime_constants::{
|
||||
xcm::body::{FELLOWSHIP_ADMIN_INDEX, TREASURER_INDEX},
|
||||
};
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter as XcmCurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
|
||||
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative,
|
||||
ChildParachainConvertsVia, DescribeBodyTerminal, DescribeFamily, FrameTransactionalProcessor,
|
||||
HashedDescription, IsConcrete, MintLocation, OriginToPluralityVoice, SignedAccountId32AsNative,
|
||||
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId,
|
||||
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
FungibleAdapter, HashedDescription, IsConcrete, MintLocation, OriginToPluralityVoice,
|
||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
||||
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::XcmExecutor;
|
||||
@@ -75,8 +73,7 @@ pub type LocationConverter = (
|
||||
HashedDescription<AccountId, DescribeFamily<DescribeBodyTerminal>>,
|
||||
);
|
||||
|
||||
#[allow(deprecated)]
|
||||
pub type LocalAssetTransactor = XcmCurrencyAdapter<
|
||||
pub type LocalAssetTransactor = FungibleAdapter<
|
||||
// Use this currency:
|
||||
Balances,
|
||||
// Use this currency when it is a fungible asset matching the given location or name:
|
||||
|
||||
@@ -64,13 +64,16 @@ benchmarks_instance_pallet! {
|
||||
transfer_asset {
|
||||
let (sender_account, sender_location) = account_and_location::<T>(1);
|
||||
let asset = T::get_asset();
|
||||
let assets: Assets = vec![ asset.clone() ].into();
|
||||
let assets: Assets = vec![asset.clone()].into();
|
||||
// this xcm doesn't use holding
|
||||
|
||||
let dest_location = T::valid_destination()?;
|
||||
let dest_account = T::AccountIdConverter::convert_location(&dest_location).unwrap();
|
||||
|
||||
<AssetTransactorOf<T>>::deposit_asset(&asset, &sender_location, None).unwrap();
|
||||
// We deposit the asset twice so we have enough for ED after transferring
|
||||
<AssetTransactorOf<T>>::deposit_asset(&asset, &sender_location, None).unwrap();
|
||||
let sender_account_balance_before = T::TransactAsset::balance(&sender_account);
|
||||
assert!(T::TransactAsset::balance(&dest_account).is_zero());
|
||||
|
||||
let mut executor = new_executor::<T>(sender_location);
|
||||
@@ -79,7 +82,7 @@ benchmarks_instance_pallet! {
|
||||
}: {
|
||||
executor.bench_process(xcm)?;
|
||||
} verify {
|
||||
assert!(T::TransactAsset::balance(&sender_account).is_zero());
|
||||
assert!(T::TransactAsset::balance(&sender_account) < sender_account_balance_before);
|
||||
assert!(!T::TransactAsset::balance(&dest_account).is_zero());
|
||||
}
|
||||
|
||||
@@ -93,11 +96,12 @@ benchmarks_instance_pallet! {
|
||||
&dest_location,
|
||||
FeeReason::TransferReserveAsset
|
||||
);
|
||||
let sender_account_balance_before = T::TransactAsset::balance(&sender_account);
|
||||
|
||||
let asset = T::get_asset();
|
||||
<AssetTransactorOf<T>>::deposit_asset(&asset, &sender_location, None).unwrap();
|
||||
assert!(T::TransactAsset::balance(&sender_account) > sender_account_balance_before);
|
||||
// We deposit the asset twice so we have enough for ED after transferring
|
||||
<AssetTransactorOf<T>>::deposit_asset(&asset, &sender_location, None).unwrap();
|
||||
let sender_account_balance_before = T::TransactAsset::balance(&sender_account);
|
||||
let assets: Assets = vec![asset].into();
|
||||
assert!(T::TransactAsset::balance(&dest_account).is_zero());
|
||||
|
||||
|
||||
@@ -103,8 +103,7 @@ impl xcm_executor::traits::MatchesFungible<u64> for MatchAnyFungible {
|
||||
}
|
||||
|
||||
// Use balances as the asset transactor.
|
||||
#[allow(deprecated)]
|
||||
pub type AssetTransactor = xcm_builder::CurrencyAdapter<
|
||||
pub type AssetTransactor = xcm_builder::FungibleAdapter<
|
||||
Balances,
|
||||
MatchAnyFungible,
|
||||
AccountIdConverter,
|
||||
@@ -192,8 +191,7 @@ impl xcm_balances_benchmark::Config for Test {
|
||||
type TrustedReserve = TrustedReserve;
|
||||
|
||||
fn get_asset() -> Asset {
|
||||
let amount =
|
||||
<Balances as frame_support::traits::fungible::Inspect<u64>>::minimum_balance() as u128;
|
||||
let amount = 1_000_000_000_000;
|
||||
Asset { id: AssetId(Here.into()), fun: Fungible(amount) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,13 +30,11 @@ use sp_core::H256;
|
||||
use sp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage};
|
||||
pub use sp_std::cell::RefCell;
|
||||
use xcm::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter as XcmCurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
|
||||
AllowTopLevelPaidExecutionFrom, Case, ChildParachainAsNative, ChildParachainConvertsVia,
|
||||
ChildSystemParachainAsSuperuser, DescribeAllTerminal, FixedRateOfFungible, FixedWeightBounds,
|
||||
FrameTransactionalProcessor, FungiblesAdapter, HashedDescription, IsConcrete,
|
||||
FrameTransactionalProcessor, FungibleAdapter, FungiblesAdapter, HashedDescription, IsConcrete,
|
||||
MatchedConvertedConcreteId, NoChecking, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, TakeWeightCredit, XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
};
|
||||
@@ -424,9 +422,8 @@ pub type ForeignAssetsConvertedConcreteId = MatchedConvertedConcreteId<
|
||||
JustTry,
|
||||
>;
|
||||
|
||||
#[allow(deprecated)]
|
||||
pub type AssetTransactors = (
|
||||
XcmCurrencyAdapter<Balances, IsConcrete<RelayLocation>, SovereignAccountOf, AccountId, ()>,
|
||||
FungibleAdapter<Balances, IsConcrete<RelayLocation>, SovereignAccountOf, AccountId, ()>,
|
||||
FungiblesAdapter<
|
||||
AssetsPallet,
|
||||
ForeignAssetsConvertedConcreteId,
|
||||
|
||||
@@ -204,7 +204,7 @@ impl<
|
||||
) -> result::Result<AssetsInHolding, XcmError> {
|
||||
log::trace!(
|
||||
target: "xcm::fungible_adapter",
|
||||
"deposit_asset what: {:?}, who: {:?}",
|
||||
"withdraw_asset what: {:?}, who: {:?}",
|
||||
what, who,
|
||||
);
|
||||
let amount = Matcher::matches_fungible(what).ok_or(MatchError::AssetNotHandled)?;
|
||||
|
||||
@@ -32,14 +32,12 @@ use xcm_executor::XcmExecutor;
|
||||
|
||||
use staging_xcm_builder as xcm_builder;
|
||||
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter as XcmCurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom,
|
||||
ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser,
|
||||
FixedRateOfFungible, FixedWeightBounds, IsChildSystemParachain, IsConcrete, MintLocation,
|
||||
RespectSuspension, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation,
|
||||
TakeWeightCredit,
|
||||
FixedRateOfFungible, FixedWeightBounds, FungibleAdapter, IsChildSystemParachain, IsConcrete,
|
||||
MintLocation, RespectSuspension, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, TakeWeightCredit,
|
||||
};
|
||||
|
||||
pub type AccountId = AccountId32;
|
||||
@@ -146,14 +144,8 @@ parameter_types! {
|
||||
pub type SovereignAccountOf =
|
||||
(ChildParachainConvertsVia<ParaId, AccountId>, AccountId32Aliases<KusamaNetwork, AccountId>);
|
||||
|
||||
#[allow(deprecated)]
|
||||
pub type LocalCurrencyAdapter = XcmCurrencyAdapter<
|
||||
Balances,
|
||||
IsConcrete<KsmLocation>,
|
||||
SovereignAccountOf,
|
||||
AccountId,
|
||||
CheckAccount,
|
||||
>;
|
||||
pub type LocalCurrencyAdapter =
|
||||
FungibleAdapter<Balances, IsConcrete<KsmLocation>, SovereignAccountOf, AccountId, CheckAccount>;
|
||||
|
||||
pub type LocalAssetTransactor = (LocalCurrencyAdapter,);
|
||||
|
||||
|
||||
@@ -38,12 +38,10 @@ use polkadot_parachain_primitives::primitives::{
|
||||
DmpMessageHandler, Id as ParaId, Sibling, XcmpMessageFormat, XcmpMessageHandler,
|
||||
};
|
||||
use xcm::{latest::prelude::*, VersionedXcm};
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter as XcmCurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowUnpaidExecutionFrom, EnsureXcmOrigin, FixedRateOfFungible,
|
||||
FixedWeightBounds, FrameTransactionalProcessor, IsConcrete, NativeAsset, ParentIsPreset,
|
||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
FixedWeightBounds, FrameTransactionalProcessor, FungibleAdapter, IsConcrete, NativeAsset,
|
||||
ParentIsPreset, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation,
|
||||
};
|
||||
use xcm_executor::{Config, XcmExecutor};
|
||||
@@ -125,9 +123,8 @@ parameter_types! {
|
||||
pub const MaxAssetsIntoHolding: u32 = 64;
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
pub type LocalAssetTransactor =
|
||||
XcmCurrencyAdapter<Balances, IsConcrete<KsmLocation>, LocationToAccountId, AccountId, ()>;
|
||||
FungibleAdapter<Balances, IsConcrete<KsmLocation>, LocationToAccountId, AccountId, ()>;
|
||||
|
||||
pub type XcmRouter = super::ParachainXcmRouter<MsgQueue>;
|
||||
pub type Barrier = AllowUnpaidExecutionFrom<Everything>;
|
||||
|
||||
@@ -37,13 +37,11 @@ use polkadot_runtime_parachains::{
|
||||
origin, shared,
|
||||
};
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter as XcmCurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowUnpaidExecutionFrom, ChildParachainAsNative,
|
||||
ChildParachainConvertsVia, ChildSystemParachainAsSuperuser, FixedRateOfFungible,
|
||||
FixedWeightBounds, FrameTransactionalProcessor, IsConcrete, SignedAccountId32AsNative,
|
||||
SignedToAccountId32, SovereignSignedViaLocation,
|
||||
FixedWeightBounds, FrameTransactionalProcessor, FungibleAdapter, IsConcrete,
|
||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation,
|
||||
};
|
||||
use xcm_executor::{Config, XcmExecutor};
|
||||
|
||||
@@ -112,9 +110,8 @@ parameter_types! {
|
||||
pub type SovereignAccountOf =
|
||||
(ChildParachainConvertsVia<ParaId, AccountId>, AccountId32Aliases<ThisNetwork, AccountId>);
|
||||
|
||||
#[allow(deprecated)]
|
||||
pub type LocalAssetTransactor =
|
||||
XcmCurrencyAdapter<Balances, IsConcrete<TokenLocation>, SovereignAccountOf, AccountId, ()>;
|
||||
FungibleAdapter<Balances, IsConcrete<TokenLocation>, SovereignAccountOf, AccountId, ()>;
|
||||
|
||||
type LocalOriginConverter = (
|
||||
SovereignSignedViaLocation<SovereignAccountOf, RuntimeOrigin>,
|
||||
|
||||
@@ -37,13 +37,11 @@ use sp_runtime::traits::{Get, IdentityLookup, MaybeEquivalence};
|
||||
|
||||
use sp_std::prelude::*;
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter as XcmCurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom,
|
||||
ConvertedConcreteId, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds,
|
||||
FrameTransactionalProcessor, FungiblesAdapter, IsConcrete, NativeAsset, NoChecking,
|
||||
ParentAsSuperuser, ParentIsPreset, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
FrameTransactionalProcessor, FungibleAdapter, FungiblesAdapter, IsConcrete, NativeAsset,
|
||||
NoChecking, ParentAsSuperuser, ParentIsPreset, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, WithComputedOrigin,
|
||||
};
|
||||
use xcm_executor::{traits::JustTry, Config, XcmExecutor};
|
||||
@@ -184,9 +182,8 @@ pub fn estimate_fee_for_weight(weight: Weight) -> u128 {
|
||||
units_per_mb * (weight.proof_size() as u128) / (WEIGHT_PROOF_SIZE_PER_MB as u128)
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
pub type LocalBalancesTransactor =
|
||||
XcmCurrencyAdapter<Balances, IsConcrete<TokenLocation>, SovereignAccountOf, AccountId, ()>;
|
||||
FungibleAdapter<Balances, IsConcrete<TokenLocation>, SovereignAccountOf, AccountId, ()>;
|
||||
|
||||
pub struct FromLocationToAsset<Location, AssetId>(PhantomData<(Location, AssetId)>);
|
||||
impl MaybeEquivalence<Location, AssetIdForAssets>
|
||||
|
||||
@@ -29,13 +29,11 @@ use sp_runtime::traits::IdentityLookup;
|
||||
use polkadot_parachain_primitives::primitives::Id as ParaId;
|
||||
use polkadot_runtime_parachains::{configuration, origin, shared};
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter as XcmCurrencyAdapter;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowSubscriptionsFrom,
|
||||
AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia,
|
||||
ChildSystemParachainAsSuperuser, DescribeAllTerminal, DescribeFamily, FixedRateOfFungible,
|
||||
FixedWeightBounds, FrameTransactionalProcessor, HashedDescription, IsConcrete,
|
||||
FixedWeightBounds, FrameTransactionalProcessor, FungibleAdapter, HashedDescription, IsConcrete,
|
||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, WithComputedOrigin,
|
||||
};
|
||||
use xcm_executor::{Config, XcmExecutor};
|
||||
@@ -119,9 +117,8 @@ pub type SovereignAccountOf = (
|
||||
ChildParachainConvertsVia<ParaId, AccountId>,
|
||||
);
|
||||
|
||||
#[allow(deprecated)]
|
||||
pub type LocalBalancesTransactor =
|
||||
XcmCurrencyAdapter<Balances, IsConcrete<TokenLocation>, SovereignAccountOf, AccountId, ()>;
|
||||
FungibleAdapter<Balances, IsConcrete<TokenLocation>, SovereignAccountOf, AccountId, ()>;
|
||||
|
||||
pub type AssetTransactors = LocalBalancesTransactor;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user