Skip to content

Commit

Permalink
Check amount is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
trinitys7 committed Aug 30, 2024
1 parent 38dbdba commit b834737
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contracts/consumer/virtual-staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ fn calculate_rebalance(
let next = desired.remove(&validator).unwrap_or_else(Uint128::zero);
if tombstoned_list.contains_key(&validator) && !next.is_zero() {
let amount = tombstoned_list.get(&validator).unwrap().clone();
msgs.push(VirtualStakeMsg::Unbond { validator, amount }.into());
if !amount.amount.is_zero() {
msgs.push(VirtualStakeMsg::Unbond { validator, amount }.into());
}
continue;
}
match next.cmp(&prev) {
Expand Down

0 comments on commit b834737

Please sign in to comment.