diff --git a/bridges/modules/xcm-bridge-hub/src/dispatcher.rs b/bridges/modules/xcm-bridge-hub/src/dispatcher.rs index 1a6be1f18e6b3..eed82ae9e616e 100644 --- a/bridges/modules/xcm-bridge-hub/src/dispatcher.rs +++ b/bridges/modules/xcm-bridge-hub/src/dispatcher.rs @@ -68,7 +68,7 @@ where fn is_active(lane: Self::LaneId) -> bool { Pallet::::bridge_by_lane_id(&lane) - .and_then(|(_, bridge)| bridge.bridge_origin_relative_location.try_as().cloned().ok()) + .and_then(|(_, bridge)| (*bridge.bridge_origin_relative_location).try_into().ok()) .map(|recipient: Location| !T::LocalXcmChannelManager::is_congested(&recipient)) .unwrap_or(false) } diff --git a/bridges/modules/xcm-bridge-hub/src/exporter.rs b/bridges/modules/xcm-bridge-hub/src/exporter.rs index 6e59f0f8d2625..6fd56f40b7f71 100644 --- a/bridges/modules/xcm-bridge-hub/src/exporter.rs +++ b/bridges/modules/xcm-bridge-hub/src/exporter.rs @@ -228,8 +228,9 @@ impl, I: 'static> Pallet { } // else - suspend the bridge - let bridge_origin_relative_location = match bridge.bridge_origin_relative_location.try_as() - { + let result_bridge_origin_relative_location = + (*bridge.bridge_origin_relative_location).clone().try_into(); + let bridge_origin_relative_location = match &result_bridge_origin_relative_location { Ok(bridge_origin_relative_location) => bridge_origin_relative_location, Err(_) => { log::debug!( diff --git a/prdoc/pr_8615.prdoc b/prdoc/pr_8615.prdoc new file mode 100644 index 0000000000000..1f8845b01ea66 --- /dev/null +++ b/prdoc/pr_8615.prdoc @@ -0,0 +1,8 @@ +title: 'Bridges: Fix - Improve try-state for pallet-xcm-bridge-hub' +doc: +- audience: Runtime Dev + description: |- + Improve try-state for pallet-xcm-bridge-hub, it removes try_as and uses try_into implementation instead. +crates: +- name: pallet-xcm-bridge-hub + bump: patch