Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
feat: add bridged adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
metricaez committed Feb 6, 2024
1 parent f12b988 commit 2ed4e95
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions runtime/trappist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ pallet-tx-pause = { workspace = true }
[features]
default = ["std"]
std = [
"hex-literal",
"parity-scale-codec/std",
"serde",
"scale-info/std",
Expand Down
16 changes: 16 additions & 0 deletions runtime/trappist/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use xcm_builder::{
};
use xcm_executor::{traits::JustTry, XcmExecutor};

use hex_literal::hex;
use xcm_primitives::{AsAssetMultiLocation, ConvertedRegisteredAssetId, TrappistDropAssets};

use crate::{
Expand All @@ -62,6 +63,7 @@ parameter_types! {
pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into();
pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
pub SelfReserve: MultiLocation = MultiLocation::here();
pub EthereumCurrencyLocation: MultiLocation = MultiLocation::new(2, X2(GlobalConsensus(Ethereum { chain_id: 11155111 }), AccountKey20{ network: None, key: hex!("c9F05326311bc2a55426761Bec20057685FB80f7") }));
pub AssetsPalletLocation: MultiLocation =
PalletInstance(<Assets as PalletInfoAccess>::index() as u8).into();
// Be mindful with incoming teleports if you implement this
Expand Down Expand Up @@ -113,6 +115,20 @@ pub type LocalAssetTransactor = CurrencyAdapter<
(),
>;

/// Means for transacting the native currency on this chain.
pub type BridgedLocalAssetTransactor = CurrencyAdapter<
// Use this currency:
Balances,
// Use this currency when it is a fungible asset matching the given location or name:
IsConcrete<EthereumCurrencyLocation>,
// Convert an XCM MultiLocation into a local account id:
LocationToAccountId,
// Our chain's account ID type (we can't get away without mentioning it explicitly):
AccountId,
// We don't track any teleports.
(),
>;

/// Means for transacting assets besides the native currency on this chain.
pub type LocalFungiblesTransactor = FungiblesAdapter<
// Use this fungibles implementation:
Expand Down

0 comments on commit 2ed4e95

Please sign in to comment.