Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
faust403 committed Nov 29, 2024
1 parent 7e85b35 commit cd4ef4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion contracts/lsm-share-bond-provider/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ fn query_can_be_removed(deps: Deps<NeutronQuery>, env: Env) -> ContractResult<Bi
.into_iter()
.filter(|coin| coin.denom != *LOCAL_DENOM.to_string())
.collect::<Vec<Coin>>();
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<NeutronQuery>) -> ContractResult<Binary> {
Expand Down
4 changes: 3 additions & 1 deletion contracts/native-bond-provider/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ fn query_can_be_removed(deps: Deps<NeutronQuery>, env: Env) -> ContractResult<Bi
.into_iter()
.filter(|coin| coin.denom != *LOCAL_DENOM.to_string())
.collect::<Vec<Coin>>();
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<NeutronQuery>, _env: Env) -> ContractResult<Binary> {
Expand Down

0 comments on commit cd4ef4c

Please sign in to comment.