From cd4ef4cfee6498fc740f23aed5a4f0cca0ac2429 Mon Sep 17 00:00:00 2001 From: Vladislav Vasilev <81014877+faust403@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:57:41 +0100 Subject: [PATCH] fixes --- contracts/lsm-share-bond-provider/src/contract.rs | 5 ++++- contracts/native-bond-provider/src/contract.rs | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/contracts/lsm-share-bond-provider/src/contract.rs b/contracts/lsm-share-bond-provider/src/contract.rs index 34935b20..332933b8 100644 --- a/contracts/lsm-share-bond-provider/src/contract.rs +++ b/contracts/lsm-share-bond-provider/src/contract.rs @@ -119,7 +119,10 @@ fn query_can_be_removed(deps: Deps, env: Env) -> ContractResult>(); - Ok(to_json_binary(&all_balances_except_untrn.is_empty())?) + let result = all_balances_except_untrn.is_empty() + && PENDING_LSM_SHARES.is_empty(deps.storage) + && LSM_SHARES_TO_REDEEM.is_empty(deps.storage); + Ok(to_json_binary(&result)?) } fn query_tx_state(deps: Deps) -> ContractResult { diff --git a/contracts/native-bond-provider/src/contract.rs b/contracts/native-bond-provider/src/contract.rs index 5ecc1217..cd640cd7 100644 --- a/contracts/native-bond-provider/src/contract.rs +++ b/contracts/native-bond-provider/src/contract.rs @@ -110,7 +110,9 @@ fn query_can_be_removed(deps: Deps, env: Env) -> ContractResult>(); - Ok(to_json_binary(&all_balances_except_untrn.is_empty())?) + let non_staked_balance = NON_STAKED_BALANCE.load(deps.storage)?; + let result = all_balances_except_untrn.is_empty() && (non_staked_balance.is_zero()); + Ok(to_json_binary(&result)?) } fn query_tx_state(deps: Deps, _env: Env) -> ContractResult {