From 1f0791cdeb77645b923cd3be0fb07e8083a0c9d3 Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Mon, 11 Sep 2023 12:22:43 +1200 Subject: [PATCH] use limited reserve transfer --- modules/relaychain/src/lib.rs | 3 ++- modules/support/src/relaychain.rs | 14 +++++++------- ..._to_liquid_crowdloan_module_account_kusama.snap | 3 ++- ...o_liquid_crowdloan_module_account_polkadot.snap | 3 ++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/modules/relaychain/src/lib.rs b/modules/relaychain/src/lib.rs index 0c0547abb9..3b3d160936 100644 --- a/modules/relaychain/src/lib.rs +++ b/modules/relaychain/src/lib.rs @@ -148,11 +148,12 @@ where assets: MultiAssets, fee_assets_item: u32, ) -> RCC { - RCC::xcm_pallet(XcmCall::ReserveTransferAssets( + RCC::xcm_pallet(XcmCall::LimitedReserveTransferAssets( dest.into_versioned(), beneficiary.into_versioned(), assets.into(), fee_assets_item, + WeightLimit::Unlimited, )) } diff --git a/modules/support/src/relaychain.rs b/modules/support/src/relaychain.rs index bb4ddc233d..052aaf0b51 100644 --- a/modules/support/src/relaychain.rs +++ b/modules/support/src/relaychain.rs @@ -41,11 +41,9 @@ pub enum UtilityCall { #[derive(Encode, Decode, RuntimeDebug)] pub enum StakingCall { #[codec(index = 1)] - BondExtra(#[codec(compact)] Balance), /* TODO: because param type in relaychain is u64, need to confirm - * Balance(u128) is working. */ + BondExtra(#[codec(compact)] Balance), #[codec(index = 2)] - Unbond(#[codec(compact)] Balance), /* TODO: because param type in relaychain is u64, need to confirm - * Balance(u128) is working. */ + Unbond(#[codec(compact)] Balance), #[codec(index = 3)] WithdrawUnbonded(u32), } @@ -53,13 +51,15 @@ pub enum StakingCall { /// `pallet-xcm` calls. #[derive(Encode, Decode, RuntimeDebug)] pub enum XcmCall { - /// `reserve_transfer_assets(dest, beneficiary, assets, fee_asset_item)` call. - #[codec(index = 2)] - ReserveTransferAssets( + /// `limited_reserve_transfer_assets(dest, beneficiary, assets, fee_asset_item, weight_limit)` + /// call. + #[codec(index = 8)] + LimitedReserveTransferAssets( VersionedMultiLocation, VersionedMultiLocation, VersionedMultiAssets, u32, + WeightLimit, ), } diff --git a/modules/xcm-interface/src/snapshots/module_xcm_interface__tests__build_transfer_to_liquid_crowdloan_module_account_kusama.snap b/modules/xcm-interface/src/snapshots/module_xcm_interface__tests__build_transfer_to_liquid_crowdloan_module_account_kusama.snap index efcd77cbcf..a1dcc7b568 100644 --- a/modules/xcm-interface/src/snapshots/module_xcm_interface__tests__build_transfer_to_liquid_crowdloan_module_account_kusama.snap +++ b/modules/xcm-interface/src/snapshots/module_xcm_interface__tests__build_transfer_to_liquid_crowdloan_module_account_kusama.snap @@ -79,7 +79,7 @@ Xcm( 1, 0, 99, - 2, + 8, 3, 0, 1, @@ -139,6 +139,7 @@ Xcm( 0, 0, 0, + 0, ], }, RefundSurplus, diff --git a/modules/xcm-interface/src/snapshots/module_xcm_interface__tests__build_transfer_to_liquid_crowdloan_module_account_polkadot.snap b/modules/xcm-interface/src/snapshots/module_xcm_interface__tests__build_transfer_to_liquid_crowdloan_module_account_polkadot.snap index 7c9758d0fc..ac17cba08b 100644 --- a/modules/xcm-interface/src/snapshots/module_xcm_interface__tests__build_transfer_to_liquid_crowdloan_module_account_polkadot.snap +++ b/modules/xcm-interface/src/snapshots/module_xcm_interface__tests__build_transfer_to_liquid_crowdloan_module_account_polkadot.snap @@ -79,7 +79,7 @@ Xcm( 1, 0, 99, - 2, + 8, 3, 0, 1, @@ -139,6 +139,7 @@ Xcm( 0, 0, 0, + 0, ], }, RefundSurplus,