Skip to content

Commit

Permalink
xtokens: update CurrencyId converter
Browse files Browse the repository at this point in the history
  • Loading branch information
hounsette committed Feb 22, 2023
1 parent 41ba8de commit 90bd6e6
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions runtimes/eden/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,16 @@ impl Convert<MultiLocation, Option<CurrencyId>> for CurrencyIdConvert {
if location == MultiLocation::parent() {
return None;
}
match location {
MultiLocation {
parents,
interior: X2(Parachain(ParachainInfo::parachain_id()), PalletInstance(key)),
} if parents == 1 => {
match (para_id, key) {
(id, 2) => {
if id == u32::from(ParachainInfo::parachain_id()) {
Some(CurrencyId::SelfReserve)
} else {
None
}
} // Pallet instance 2 for balances pallet : TODO: refactor
_ => None,
match location.first_interior() {
Junctions::X2(Parachain(para_id), PalletInstance(key)) => {
if (
ParachainInfo::parachain_id(),
<Balances as PalletInfoAccess>::index() as u8,
) == (para_id, key)
{
Some(CurrencyId::NodleNative)
} else {
None
}
}
_ => None,
Expand Down

0 comments on commit 90bd6e6

Please sign in to comment.