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

Commit

Permalink
Charge price for the sender cost
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Apr 3, 2024
1 parent 5197b49 commit 2a64631
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions polkadot/xcm/pallet-xcm/src/ethereum.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use crate::{Box, Config, Error, Event, FeesHandling, Instruction::BurnAsset, Pallet, Vec, Xcm};
use crate::{
vec, Box, Config, Error, Event, FeesHandling, Instruction::BurnAsset, Pallet, Vec, Xcm,
};
use codec::Encode;
use frame_support::{
dispatch::DispatchResult,
Expand Down Expand Up @@ -170,10 +172,15 @@ impl<T: Config> Pallet<T> {
})?;

if let Some(remote_xcm) = remote_xcm {
let (ticket, _) = validate_send::<T::XcmRouter>(dest.clone(), remote_xcm.clone())
let (ticket, price) = validate_send::<T::XcmRouter>(dest.clone(), remote_xcm.clone())
.map_err(Error::<T>::from)?;
if origin != Here.into_location() {
Self::charge_fees(origin.clone(), fees).map_err(|error| {
let total_fees: Assets = vec![fees, price]
.iter()
.flat_map(|s| s.clone().into_inner())
.collect::<Vec<Asset>>()
.into();
Self::charge_fees(origin.clone(), total_fees).map_err(|error| {
log::error!(
target: "xcm::pallet_xcm::execute_xcm_transfer",
"Unable to charge fee with error {:?}", error
Expand Down

0 comments on commit 2a64631

Please sign in to comment.