mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-03-30 15:08:28 +00:00
fix(dao): challenger and challengee can be empty
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
This commit is contained in:
parent
190f24a10b
commit
29b20e4392
@ -73,7 +73,13 @@ func (k msgServer) clearUnresolvedClaims(ctx sdk.Context, start int64) (err erro
|
||||
|
||||
totalAmounts := make(map[string]uint64)
|
||||
for participantAddress := range currentAmounts {
|
||||
stagedBalance := k.bankKeeper.GetBalance(ctx, sdk.MustAccAddressFromBech32(participantAddress), k.GetParams(ctx).StagedDenom)
|
||||
// the challenger and challengee can be empty
|
||||
participantAddressHex, err := sdk.AccAddressFromBech32(participantAddress)
|
||||
if err != nil {
|
||||
// try to convert as many claims as possible
|
||||
continue
|
||||
}
|
||||
stagedBalance := k.bankKeeper.GetBalance(ctx, participantAddressHex, k.GetParams(ctx).StagedDenom)
|
||||
totalAmounts[participantAddress] = stagedBalance.Amount.Uint64()
|
||||
}
|
||||
|
||||
@ -150,7 +156,8 @@ func (k msgServer) convertOrderedClaim(ctx sdk.Context, claims map[string]uint64
|
||||
for _, accountAddress := range keys {
|
||||
err = k.convertAccountClaim(ctx, accountAddress, claims[accountAddress])
|
||||
if err != nil {
|
||||
return err
|
||||
// try to convert as many claims as possible
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user