From dfe1e54f8b9a259f8581ca52848c9af2cee0e14e Mon Sep 17 00:00:00 2001 From: Kerber0x Date: Thu, 11 Apr 2024 15:48:10 +0100 Subject: [PATCH] chore: refactor funds validation --- .../liquidity_hub/pool-manager/src/liquidity/commands.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contracts/liquidity_hub/pool-manager/src/liquidity/commands.rs b/contracts/liquidity_hub/pool-manager/src/liquidity/commands.rs index b078b29e..4075a225 100644 --- a/contracts/liquidity_hub/pool-manager/src/liquidity/commands.rs +++ b/contracts/liquidity_hub/pool-manager/src/liquidity/commands.rs @@ -220,9 +220,8 @@ pub fn withdraw_liquidity( let mut pair = get_pair_by_identifier(&deps.as_ref(), &pair_identifier)?; let liquidity_token = pair.lp_denom.clone(); // Verify that the LP token was sent - if info.funds.is_empty() || info.funds[0].denom != liquidity_token { - return Err(ContractError::Unauthorized {}); - } + cw_utils::must_pay(&info, &liquidity_token)?; + // Get the total share of the pool let total_share = get_total_share(&deps.as_ref(), liquidity_token.clone())?;