Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
AurevoirXavier committed Aug 28, 2023
1 parent a22cb12 commit 1ff8517
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions runtime/pangolin/src/pallets/asset_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ impl pallet_asset_manager::LocalAssetIdCreator<Runtime> for LocalAssetIdCreator
}
}

frame_support::parameter_types! {
/// 1000 is AssetHub paraId.
/// 50 is pallet-assets index on AssetHub.
/// 7777 is the id of Test USDT on AssetHub(Rococo).
pub UsdtLocation: MultiLocation = MultiLocation::new(
1,
X3(Parachain(1000), PalletInstance(50), GeneralIndex(7777))
);
}

// Our AssetType. For now we only handle Xcm Assets
#[derive(Clone, Eq, Debug, PartialEq, Ord, PartialOrd, Encode, Decode, TypeInfo)]
pub enum AssetType {
Expand All @@ -114,9 +104,8 @@ impl Into<Option<MultiLocation>> for AssetType {
}
}
}

// Implementation on how to retrieve the AssetId from an AssetType
// We simply hash the AssetType and take the lowest 128 bits
// Implementation on how to retrieve the AssetId from an `AssetType`.
// We simply hash the `AssetType` and take the lowest 128 bits.
impl From<AssetType> for crate::AssetId {
fn from(asset: AssetType) -> crate::AssetId {
match asset {
Expand All @@ -133,6 +122,16 @@ impl From<AssetType> for crate::AssetId {
}
}

frame_support::parameter_types! {
/// 1000 is AssetHub paraId.
/// 50 is pallet-assets index on AssetHub.
/// 7777 is the id of Test USDT on AssetHub(Rococo).
pub UsdtLocation: MultiLocation = MultiLocation::new(
1,
X3(Parachain(1000), PalletInstance(50), GeneralIndex(7777))
);
}

impl pallet_asset_manager::Config for Runtime {
type AssetId = crate::AssetId;
type AssetRegistrar = AssetRegistrar;
Expand Down

0 comments on commit 1ff8517

Please sign in to comment.