Direct XCM ExportMessage fees for different bridges to different receiver accounts (#2021)

This commit is contained in:
Serban Iorga
2023-11-01 17:11:07 +02:00
committed by GitHub
parent 8507f45cef
commit dce5a8da66
14 changed files with 275 additions and 71 deletions
@@ -18,12 +18,12 @@ use xcm::prelude::*;
/// Handle stuff to do with taking fees in certain XCM instructions.
pub trait FeeManager {
/// Determine if a fee which would normally payable should be waived.
/// Determine if a fee should be waived.
fn is_waived(origin: Option<&MultiLocation>, r: FeeReason) -> bool;
/// Do something with the fee which has been paid. Doing nothing here silently burns the
/// fees.
fn handle_fee(fee: MultiAssets, context: Option<&XcmContext>);
fn handle_fee(fee: MultiAssets, context: Option<&XcmContext>, r: FeeReason);
}
/// Context under which a fee is paid.
@@ -42,7 +42,7 @@ pub enum FeeReason {
/// When the `QueryPallet` instruction is called.
QueryPallet,
/// When the `ExportMessage` instruction is called (and includes the network ID).
Export(NetworkId),
Export { network: NetworkId, destination: InteriorMultiLocation },
/// The `charge_fees` API.
ChargeFees,
/// When the `LockAsset` instruction is called.
@@ -55,5 +55,6 @@ impl FeeManager for () {
fn is_waived(_: Option<&MultiLocation>, _: FeeReason) -> bool {
false
}
fn handle_fee(_: MultiAssets, _: Option<&XcmContext>) {}
fn handle_fee(_: MultiAssets, _: Option<&XcmContext>, _: FeeReason) {}
}