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

Commit

Permalink
complete token transfer test
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden authored and claravanstaden committed Oct 6, 2023
1 parent ba2e1ac commit 5ea5c19
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<u8>| {
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<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::EthereumOutboundQueue(event)) => Some(event),
_ => None,
}
})
)
}
}
Expand Down

0 comments on commit 5ea5c19

Please sign in to comment.