mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 23:21:02 +00:00
Make penpal-runtime's TrustedReserves more connfigurable (#3564)
The current `penpal` runtime utilizes the `EthereumLocation` parameter, which is employed for XCM emulated integration tests concerning the Rococo <> ETH bridge. It includes a hard-coded chainId for the Ethereum testnet utilized in Rococo. The `EthereumLocation` serves the purpose of aligning with the `TrustedReserves`. However, due to this hard-coded configuration, reusing `penpal` for testing various environments such as Kusama/Polkadot versus Ethereum bridge becomes unfeasible. This PR introduces the capability to easily customize the asset location for `TrustedReserves` without needing to know anything about Ethereum. ## TODO - [x] fix integration tests with `System::set_storage(CustomizableAssetFromSystemAssetHub::key(), <whatever-location-is-needed>)` @claravanstaden - [ ] ~~maybe add some helper function/macro to support `set_storage` for other runtimes (that we could reuse)~~ - [ ] Release patch for: `penpal-runtime` + emulated crate with `set_storage` support (if needed) - [ ] backport to 1.7.0 - [ ] backport to 1.8.0 --------- Co-authored-by: Clara van Staden <claravanstaden64@gmail.com>
This commit is contained in:
+11
@@ -18,6 +18,7 @@ use codec::{Decode, Encode};
|
||||
use emulated_integration_tests_common::xcm_emulator::ConvertLocation;
|
||||
use frame_support::pallet_prelude::TypeInfo;
|
||||
use hex_literal::hex;
|
||||
use rococo_system_emulated_network::penpal_emulated_chain::CustomizableAssetFromSystemAssetHub;
|
||||
use rococo_westend_system_emulated_network::BridgeHubRococoParaSender as BridgeHubRococoSender;
|
||||
use snowbridge_core::outbound::OperatingMode;
|
||||
use snowbridge_pallet_inbound_queue_fixtures::{
|
||||
@@ -253,6 +254,16 @@ fn send_token_from_ethereum_to_penpal() {
|
||||
(PenpalASender::get(), INITIAL_FUND),
|
||||
]);
|
||||
|
||||
PenpalA::execute_with(|| {
|
||||
assert_ok!(<PenpalA as Chain>::System::set_storage(
|
||||
<PenpalA as Chain>::RuntimeOrigin::root(),
|
||||
vec![(
|
||||
CustomizableAssetFromSystemAssetHub::key().to_vec(),
|
||||
Location::new(2, [GlobalConsensus(Ethereum { chain_id: CHAIN_ID })]).encode(),
|
||||
)],
|
||||
));
|
||||
});
|
||||
|
||||
// The Weth asset location, identified by the contract address on Ethereum
|
||||
let weth_asset_location: Location =
|
||||
(Parent, Parent, EthereumNetwork::get(), AccountKey20 { network: None, key: WETH }).into();
|
||||
|
||||
Reference in New Issue
Block a user