Trait xcm_builder::test_utils::AssetExchange
pub trait AssetExchange {
// Required method
fn exchange_asset(
origin: Option<&MultiLocation>,
give: Assets,
want: &MultiAssets,
maximal: bool
) -> Result<Assets, Assets>;
}
Expand description
A service for exchanging assets.
Required Methods§
fn exchange_asset(
origin: Option<&MultiLocation>,
give: Assets,
want: &MultiAssets,
maximal: bool
) -> Result<Assets, Assets>
fn exchange_asset( origin: Option<&MultiLocation>, give: Assets, want: &MultiAssets, maximal: bool ) -> Result<Assets, Assets>
Handler for exchanging an asset.
origin
: The location attempting the exchange; this should generally not matter.give
: The assets which have been removed from the caller.want
: The minimum amount of assets which should be given to the caller in case any exchange happens. If more assets are provided, then they should generally be of the same asset class if at all possible.maximal
: Iftrue
, then as much as possible should be exchanged.
Ok
is returned along with the new set of assets which have been exchanged for give
. At
least want must be in the set. Some assets originally in give
may also be in this set. In
the case of returning an Err
, then give
is returned.