diff --git a/Cargo.lock b/Cargo.lock index 9c6fbd35..513972a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -763,7 +763,7 @@ dependencies = [ [[package]] name = "incentive" -version = "1.0.6" +version = "1.0.8" dependencies = [ "classic-bindings", "cosmwasm-schema", diff --git a/contracts/liquidity_hub/pool-network/incentive/Cargo.toml b/contracts/liquidity_hub/pool-network/incentive/Cargo.toml index 60846785..06697a6e 100644 --- a/contracts/liquidity_hub/pool-network/incentive/Cargo.toml +++ b/contracts/liquidity_hub/pool-network/incentive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "incentive" -version = "1.0.6" +version = "1.0.8" authors = ["kaimen-sano "] edition.workspace = true description = "An incentive manager for an LP token" diff --git a/contracts/liquidity_hub/pool-network/incentive/src/execute/close_position.rs b/contracts/liquidity_hub/pool-network/incentive/src/execute/close_position.rs index b27c8b8f..99374e57 100644 --- a/contracts/liquidity_hub/pool-network/incentive/src/execute/close_position.rs +++ b/contracts/liquidity_hub/pool-network/incentive/src/execute/close_position.rs @@ -21,19 +21,11 @@ pub fn close_position( ) -> Result { //query and check if the user has pending rewards let rewards_query_result = get_rewards(deps.as_ref(), info.sender.clone().into_string()); - match rewards_query_result { - Ok(rewards_response) => { - // can't close a position if there are pending rewards - if !rewards_response.rewards.is_empty() { - return Err(ContractError::PendingRewards {}); - } - } - Err(error) => { - //if it has nothing to claim, then close the position - match error { - ContractError::NothingToClaim {} => {} - _ => return Err(ContractError::InvalidReward {}), - } + + if let Ok(rewards_response) = rewards_query_result { + // can't close a position if there are pending rewards + if !rewards_response.rewards.is_empty() { + return Err(ContractError::PendingRewards {}); } }