Skip to content

Commit

Permalink
change(kreivo-runtime): use separate filter for specific foreign asse…
Browse files Browse the repository at this point in the history
…ts reserves
  • Loading branch information
pandres95 committed Jun 27, 2024
1 parent 6d15c2c commit 15401f9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion runtime/kreivo/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@ impl<Prefix: Get<Location>> ContainsPair<Asset, Location> for ReserveAssetsFrom<
matches_prefix(&Prefix::get(), &asset.id.0)
}
}
pub struct ReserveForeignAssetsFrom<P, R>(PhantomData<(P, R)>);
impl<Prefix: Get<Location>, ReserveLocation: Get<Location>> ContainsPair<Asset, Location>
for ReserveForeignAssetsFrom<Prefix, ReserveLocation>
{
fn contains(asset: &Asset, origin: &Location) -> bool {
log::trace!(target: "xcm::AssetsFrom", "prefix: {:?}, origin: {:?}", Prefix::get(), origin);
&ReserveLocation::get() == origin && matches_prefix(&Prefix::get(), &asset.id.0)
}
}

pub type AssetFeeAsExistentialDepositMultiplierFeeCharger = AssetFeeAsExistentialDepositMultiplier<
Runtime,
Expand All @@ -213,7 +222,7 @@ pub type Traders = (
pub type Reserves = (
NativeAsset,
ReserveAssetsFrom<AssetHubLocation>,
ReserveAssetsFrom<PolkadotLocation>,
ReserveForeignAssetsFrom<PolkadotLocation, AssetHubLocation>,
);

pub struct XcmConfig;
Expand Down

0 comments on commit 15401f9

Please sign in to comment.