This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Descend to user origin & Burn fee from the user #168
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yrong
commented
Aug 1, 2024
Comment on lines
+390
to
+395
let (ticket, fee, fee_to_burn) = | ||
validate_send::<Config::XcmSender>(dest, msg, self.origin_ref())?; | ||
self.take_fee(fee, reason.clone())?; | ||
if let Some(fee_to_burn) = fee_to_burn { | ||
self.burn_fee(fee_to_burn, reason)?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make validate_send
return an extra fees(optional) for burning.
yrong
commented
Aug 1, 2024
Comment on lines
+499
to
510
let sender = if let Some(origin) = source { Some(origin.clone().interior) } else { None } | ||
.ok_or(NotApplicable)?; | ||
|
||
let mut message = Xcm(if let Some(ref payment) = maybe_payment { | ||
let fees = payment | ||
.clone() | ||
.reanchored(&bridge, &UniversalLocation::get()) | ||
.map_err(|_| Unroutable)?; | ||
vec![ | ||
DescendOrigin(sender), | ||
ReceiveTeleportedAsset(fees.clone().into()), | ||
BuyExecution { fees, weight_limit: Unlimited }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In custom exporter we add DescendOrigin
into the outer Xcm of the export message.
yrong
commented
Aug 2, 2024
@@ -461,7 +461,7 @@ impl<Bridges: ExporterFor, Router: SendXcm, UniversalLocation: Get<InteriorLocat | |||
fn validate( | |||
dest: &mut Option<Location>, | |||
msg: &mut Option<Xcm<()>>, | |||
_source: Option<&Location>, | |||
source: Option<&Location>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the source location(optional) to SendXcm
trait so that we can DescendOrigin
to the souce location(i.e. user) later.
#169 as prerequisite which is a breaking change.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.