From 706addd107ddd413bdc42c1d8f8fa03600ef50ba Mon Sep 17 00:00:00 2001 From: Greg Zaitsev Date: Fri, 27 Feb 2026 16:14:06 -0500 Subject: [PATCH] Fix undefined behavior on i64::MIN in modify_position --- pallets/swap/src/pallet/impls.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/swap/src/pallet/impls.rs b/pallets/swap/src/pallet/impls.rs index 38830ec688..be5e99263d 100644 --- a/pallets/swap/src/pallet/impls.rs +++ b/pallets/swap/src/pallet/impls.rs @@ -580,7 +580,7 @@ impl Pallet { // Small delta is not allowed ensure!( - liquidity_delta.abs() >= T::MinimumLiquidity::get() as i64, + liquidity_delta.unsigned_abs() >= T::MinimumLiquidity::get(), Error::::InvalidLiquidityValue ); let mut delta_liquidity_abs = liquidity_delta.unsigned_abs();