From 82c44e8c308e764a7d48916c11a3d08dab0fe80f Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Mon, 30 Oct 2023 11:51:19 +0200 Subject: [PATCH] correct relay network check --- .../bridge-hubs/bridge-hub-rococo/src/xcm_config.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index 3ab91d011cfb..a01d9a26342c 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -418,6 +418,7 @@ impl ExportXcm for BridgeHubRococoOrBridgeHubWococoSwitchExporter { destination: &mut Option, message: &mut Option>, ) -> SendResult { + let relay: NetworkId = RelayNetwork::get(); match network { Rococo => ToBridgeHubRococoHaulBlobExporter::validate( network, @@ -435,7 +436,7 @@ impl ExportXcm for BridgeHubRococoOrBridgeHubWococoSwitchExporter { message, ) .map(|result| ((Wococo, result.0), result.1)), - location if location == EthereumNetwork::get() && network == Rococo => { + location if location == EthereumNetwork::get() && relay == Rococo => { SnowbridgeExporter::validate( network, channel, @@ -451,10 +452,11 @@ impl ExportXcm for BridgeHubRococoOrBridgeHubWococoSwitchExporter { fn deliver(ticket: Self::Ticket) -> Result { let (network, ticket) = ticket; + let relay: NetworkId = RelayNetwork::get(); match network { Rococo => ToBridgeHubRococoHaulBlobExporter::deliver(ticket), Wococo => ToBridgeHubWococoHaulBlobExporter::deliver(ticket), - location if location == EthereumNetwork::get() && network == Rococo => + location if location == EthereumNetwork::get() && relay == Rococo => SnowbridgeExporter::deliver(ticket), _ => unimplemented!("Unsupported network: {:?}", network), }