Skip to content

Commit

Permalink
change moonriver xtoken transfer weight param
Browse files Browse the repository at this point in the history
  • Loading branch information
herryho committed Dec 19, 2022
1 parent 988eac4 commit 4270328
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
8 changes: 2 additions & 6 deletions pallets/slp/src/agents/moonbeam_agent/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ use xcm::{
opaque::latest::{
Junction::{AccountId32, Parachain},
Junctions::X1,
MultiLocation,
MultiLocation, WeightLimit,
},
VersionedMultiLocation,
};
Expand Down Expand Up @@ -810,16 +810,12 @@ impl<T: Config>
),
}));

let (weight, _) =
XcmDestWeightAndFee::<T>::get(currency_id, XcmOperation::XtokensTransferBack)
.ok_or(Error::<T>::WeightAndFeeNotExists)?;

// Construct xcm message.
let call = MoonbeamCall::Xtokens(MoonbeamXtokensCall::Transfer(
MoonbeamCurrencyId::SelfReserve,
amount.unique_saturated_into(),
dest,
weight,
WeightLimit::Unlimited,
));

// Wrap the xcm message as it is sent from a subaccount of the parachain account, and
Expand Down
8 changes: 3 additions & 5 deletions pallets/slp/src/agents/moonbeam_agent/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use crate::{agents::SystemCall, Weight};
use crate::{agents::SystemCall, BalanceOf, Config};
use codec::{Decode, Encode};
use frame_support::RuntimeDebug;
use scale_info::TypeInfo;
use sp_core::H160;
use sp_runtime::traits::{IdentityLookup, StaticLookup};
use sp_std::{boxed::Box, vec::Vec};
use xcm::VersionedMultiLocation;

use crate::{BalanceOf, Config};
use xcm::{opaque::latest::WeightLimit, VersionedMultiLocation};

#[derive(Encode, Decode, RuntimeDebug, Clone)]
pub enum MoonbeamCall<T: Config> {
Expand Down Expand Up @@ -83,7 +81,7 @@ pub enum MoonbeamParachainStakingCall<T: Config> {
#[derive(Encode, Decode, RuntimeDebug, Clone)]
pub enum MoonbeamXtokensCall<T: Config> {
#[codec(index = 0)]
Transfer(MoonbeamCurrencyId, BalanceOf<T>, Box<VersionedMultiLocation>, Weight),
Transfer(MoonbeamCurrencyId, BalanceOf<T>, Box<VersionedMultiLocation>, WeightLimit),
}

#[derive(PartialEq, Eq, Copy, Clone, Encode, Decode, RuntimeDebug, TypeInfo)]
Expand Down

0 comments on commit 4270328

Please sign in to comment.