From 5ea5c192d8fc45f8abe22a6ea1643c6552942557 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Fri, 6 Oct 2023 10:58:04 +0200 Subject: [PATCH] complete token transfer test --- .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 2 +- .../bridge-hub-rococo/tests/tests.rs | 38 +++++++++---------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index d8d69c3cea7a..15428211e212 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -595,7 +595,7 @@ impl pallet_bridge_relayers::Config for Runtime { parameter_types! { pub const Reward: u128 = 10; - pub const GatewayAddress: H160 = H160(EthereumGatewayAddress::get()); // TODO Update https://github.com/Snowfork/cumulus/commit/f5180878ca95afd9f8b9525d54daa5ed4a2b9505 + pub const GatewayAddress: H160 = H160(EthereumGatewayAddress::get()); } #[cfg(feature = "runtime-benchmarks")] diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs index 0524fc3ab396..3dc3321c9025 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs @@ -103,6 +103,7 @@ mod bridge_hub_rococo_tests { BridgeGrandpaWococoInstance, BridgeParachainWococoInstance, WithBridgeHubWococoMessagesInstance, }; + use sp_core::H160; bridge_hub_test_utils::test_cases::include_teleports_for_native_asset_works!( Runtime, @@ -275,26 +276,23 @@ mod bridge_hub_rococo_tests { } #[test] - pub fn transfer_token_works() { - let gateway_proxy_address = hex!("EDa338E4dC46038493b885327842fD3E301CaB39"); - let weth_contract_address = hex!("87d1f7fdfEe7f651FaBc8bFCB6E086C278b77A7d"); - let destination_contract = hex!("44a57ee2f2FCcb85FDa2B0B18EBD0D8D2333700e"); - bridge_hub_test_utils::test_cases::handle_transfer_token_message::< - Runtime, - XcmConfig, - >( - collator_session_keys(), - bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID, - bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID, - gateway_proxy_address.into(), - weth_contract_address.into(), - destination_contract.into(), - Box::new(|runtime_event_encoded: Vec| { - match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { - Ok(RuntimeEvent::EthereumOutboundQueue(event)) => Some(event), - _ => None, - } - }) + pub fn transfer_token_to_ethereum() { + bridge_hub_test_utils::test_cases::handle_transfer_token_message::< + Runtime, + XcmConfig, + >( + collator_session_keys(), + bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID, + bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID, + bridge_hub_rococo_runtime::GatewayAddress::get(), + H160::random(), + H160::random(), + Box::new(|runtime_event_encoded: Vec| { + match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) { + Ok(RuntimeEvent::EthereumOutboundQueue(event)) => Some(event), + _ => None, + } + }) ) } }