-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
296 Enable XCM assets on Pendulum (#339)
* first iteration * add moonbeam; also move macro to `common` * added PDEX #296 (comment) * segregate assets/tokens added EURC * #339 (comment), #339 (comment), #339 (comment) * https://github.com/pendulum-chain/pendulum/actions/runs/6926668943/job/18839202556?pr=339#step:8:2029 * #339 (comment) * cargo fmt
- Loading branch information
Showing
17 changed files
with
388 additions
and
111 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#![allow(non_snake_case)] | ||
|
||
pub mod xcm_assets { | ||
use runtime_common::create_xcm_id; | ||
|
||
create_xcm_id!(RELAY_KSM, 0); | ||
create_xcm_id!(ASSETHUB_USDT, 1); | ||
} | ||
|
||
/// Locations for native currency and all natively issued tokens | ||
pub mod native_locations { | ||
use crate::ParachainInfo; | ||
use frame_support::traits::PalletInfoAccess; | ||
use xcm::latest::{ | ||
Junction::{PalletInstance, Parachain}, | ||
Junctions::{X1, X2}, | ||
MultiLocation, | ||
}; | ||
|
||
fn balances_pallet_id() -> u8 { | ||
crate::Balances::index() as u8 | ||
} | ||
|
||
/// location of the native currency from the point of view of Pendulum parachain | ||
pub fn native_location_local_pov() -> MultiLocation { | ||
MultiLocation { parents: 0, interior: X1(PalletInstance(balances_pallet_id())) } | ||
} | ||
|
||
/// location of the native currency from the point of view of other parachains(external) | ||
pub fn native_location_external_pov() -> MultiLocation { | ||
MultiLocation { | ||
parents: 1, | ||
interior: X2( | ||
Parachain(ParachainInfo::parachain_id().into()), | ||
PalletInstance(balances_pallet_id()), | ||
), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.