Skip to content

Commit

Permalink
feat: add MultiLocationsFilter to kintsugi
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory Hill <[email protected]>
  • Loading branch information
gregdhill committed Apr 7, 2022
1 parent aaf1626 commit 6fc2532
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion parachain/runtime/kintsugi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use codec::Encode;
use currency::Amount;
use frame_support::{
dispatch::{DispatchError, DispatchResult},
match_type,
traits::{
Contains, Currency as PalletCurrency, EnsureOneOf, EnsureOrigin, EqualPrivilegeOnly, ExistenceRequirement,
FindAuthor, Imbalance, OnUnbalanced,
Expand Down Expand Up @@ -904,6 +905,17 @@ impl Convert<AccountId, MultiLocation> for AccountIdToMultiLocation {
}
}

match_type! {
pub type ParentOrParachains: impl Contains<MultiLocation> = {
// Kusama
MultiLocation { parents: 1, interior: Here } |
// Karura
MultiLocation { parents: 1, interior: X1(Parachain(2000)) } |
// Moonriver
MultiLocation { parents: 1, interior: X1(Parachain(2023)) }
};
}

impl orml_xtokens::Config for Runtime {
type Event = Event;
type Balance = Balance;
Expand All @@ -917,7 +929,7 @@ impl orml_xtokens::Config for Runtime {
type LocationInverter = <XcmConfig as Config>::LocationInverter;
type MaxAssetsForTransfer = MaxAssetsForTransfer;
type MinXcmFee = ParachainMinFee;
type MultiLocationsFilter = Everything;
type MultiLocationsFilter = ParentOrParachains;
type ReserveProvider = AbsoluteReserveProvider;
}

Expand Down

0 comments on commit 6fc2532

Please sign in to comment.