Skip to content
2 changes: 1 addition & 1 deletion bridges/modules/xcm-bridge-hub/src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ where

fn is_active(lane: Self::LaneId) -> bool {
Pallet::<T, I>::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)
}
Expand Down
5 changes: 3 additions & 2 deletions bridges/modules/xcm-bridge-hub/src/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
}

// 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!(
Expand Down
8 changes: 8 additions & 0 deletions prdoc/pr_8615.prdoc
Original file line number Diff line number Diff line change
@@ -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
Loading