-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #144 from InvArch/francisco-tinkernet_rings_new_ne…
…tworks Adding tokens from karura, moonriver and shiden to tinkernet rings
- Loading branch information
Showing
6 changed files
with
316 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
use super::RingsChain; | ||
use codec::{Decode, Encode, MaxEncodedLen}; | ||
use frame_support::BoundedSlice; | ||
use scale_info::TypeInfo; | ||
use xcm::latest::{Junction, Junctions, MultiLocation}; | ||
|
||
pub struct Karura; | ||
|
||
#[allow(non_camel_case_types)] | ||
#[derive(Encode, Decode, Clone, Eq, PartialEq, MaxEncodedLen, Debug, TypeInfo)] | ||
pub enum KaruraAssets { | ||
KAR, | ||
LKSM, | ||
tKSM, | ||
KSM, | ||
Local([u8; 20]), | ||
} | ||
|
||
impl RingsChain for Karura { | ||
type Assets = KaruraAssets; | ||
|
||
fn get_asset_location(asset: &Self::Assets) -> MultiLocation { | ||
use KaruraAssets::*; | ||
match asset { | ||
KAR => MultiLocation { | ||
parents: 0, | ||
interior: Junctions::X1(Junction::from(BoundedSlice::truncate_from( | ||
&hex_literal::hex!("0080"), | ||
))), | ||
}, | ||
LKSM => MultiLocation { | ||
parents: 0, | ||
interior: Junctions::X1(Junction::from(BoundedSlice::truncate_from( | ||
&hex_literal::hex!("0083"), | ||
))), | ||
}, | ||
tKSM => MultiLocation { | ||
parents: 0, | ||
interior: Junctions::X1(Junction::from(BoundedSlice::truncate_from( | ||
&hex_literal::hex!("0300000000"), | ||
))), | ||
}, | ||
KSM => MultiLocation { | ||
parents: 1, | ||
interior: Junctions::Here, | ||
}, | ||
Local(address) => MultiLocation { | ||
parents: 0, | ||
interior: Junctions::X1(Junction::from(BoundedSlice::truncate_from(address))), | ||
}, | ||
} | ||
} | ||
|
||
fn get_location() -> MultiLocation { | ||
MultiLocation { | ||
parents: 1, | ||
interior: Junctions::X1(Junction::Parachain(2000)), | ||
} | ||
} | ||
|
||
fn get_main_asset() -> Self::Assets { | ||
KaruraAssets::KAR | ||
} | ||
} |
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.