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

Commit

Permalink
Move export payment out and burn it
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Aug 1, 2024
1 parent 80a7457 commit d53fa6e
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,11 @@ impl<Bridges: ExporterFor, Router: SendXcm, UniversalLocation: Get<InteriorLocat
return Err(NotApplicable)
};

// Ensure the export fee configured is not None.
let payments: xcm::prelude::Assets =
if let Some(ref payment) = maybe_payment { Some(payment.clone().into()) } else { None }
.ok_or(NotApplicable)?;

// `xcm` should already end with `SetTopic` - if it does, then extract and derive into
// an onward topic ID.
let maybe_forward_id = match xcm.last() {
Expand Down Expand Up @@ -521,11 +526,8 @@ impl<Bridges: ExporterFor, Router: SendXcm, UniversalLocation: Get<InteriorLocat

// We then send a normal message to the bridge asking it to export the prepended
// message to the remote chain.
let (v, mut cost, _) = validate_send::<Router>(bridge, message, None)?;
if let Some(bridge_payment) = maybe_payment {
cost.push(bridge_payment);
}
Ok((v, cost, None))
let (v, cost, _) = validate_send::<Router>(bridge, message, None)?;
Ok((v, cost, Some(payments)))
}

fn deliver(ticket: Router::Ticket) -> Result<XcmHash, SendError> {
Expand Down

0 comments on commit d53fa6e

Please sign in to comment.