Skip to content

Commit

Permalink
Added bridged currency transactor
Browse files Browse the repository at this point in the history
  • Loading branch information
akru committed Feb 13, 2025
1 parent 11ec1ec commit 72b27a6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion runtime/main/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("robonomics"),
impl_name: create_runtime_str!("robonomics-airalab"),
authoring_version: 1,
spec_version: 34,
spec_version: 35,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
21 changes: 20 additions & 1 deletion runtime/main/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ parameter_types! {
pub UniversalLocation: InteriorMultiLocation =
X2(GlobalConsensus(RelayNetwork::get()), Parachain(ParachainInfo::parachain_id().into()));
pub Local: MultiLocation = Here.into_location();
pub EthereumCurrencyLocation: MultiLocation = MultiLocation::new(2, X2(GlobalConsensus(Ethereum { chain_id: 1 }), AccountKey20{ network: None, key: hex!("7de91b204c1c737bcee6f000aaa6569cf7061cb7") }));
pub AssetsPalletLocation: MultiLocation =
PalletInstance(<Assets as PalletInfoAccess>::index() as u8).into();
pub DummyCheckingAccount: AccountId = PolkadotXcm::check_account();
Expand Down Expand Up @@ -101,8 +102,26 @@ pub type FungiblesTransactor = FungiblesAdapter<
DummyCheckingAccount,
>;

/// Means for transacting the native currency on this chain.
pub type BridgedCurrencyTransactor = 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 on this chain.
pub type AssetTransactors = (CurrencyTransactor, FungiblesTransactor);
pub type AssetTransactors = (
CurrencyTransactor,
BridgedCurrencyTransactor,
FungiblesTransactor,
);

/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,
/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can
Expand Down

0 comments on commit 72b27a6

Please sign in to comment.