Skip to content

Commit

Permalink
Ignore untrn balance
Browse files Browse the repository at this point in the history
  • Loading branch information
faust403 committed Nov 20, 2024
1 parent 5451a27 commit 5667b7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/core/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ fn execute_remove_bond_provider(
.query_all_balances(bond_provider_address.clone())?;
let bond_provider_balances_except_untrn = bond_provider_balances
.into_iter()
.filter(|coin| coin.denom == UNTRN_DENOM.to_string())
.filter(|coin| coin.denom != *UNTRN_DENOM.to_string())
.collect::<Vec<Coin>>();
if !bond_provider_balances_except_untrn.is_empty() {
return Err(ContractError::BondProviderBalanceNotEmpty {});
Expand Down
14 changes: 10 additions & 4 deletions contracts/core/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,16 @@ fn test_bond_provider_has_any_tokens() {
deps.querier.add_all_balances_query_response(
"bond_provider_address".to_string(),
AllBalanceResponse {
amount: vec![Coin {
denom: "denom".to_string(),
amount: Uint128::from(123u128),
}],
amount: vec![
Coin {
denom: "denom".to_string(),
amount: Uint128::from(123u128),
},
Coin {
denom: "untrn".to_string(),
amount: Uint128::from(123u128),
},
],
},
);

Expand Down

0 comments on commit 5667b7d

Please sign in to comment.