From 702b9d6f7eb700b30e8c146edc35cfe4a09bb2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Eckel?= Date: Fri, 15 Nov 2024 12:15:23 +0100 Subject: [PATCH] * clear unresolved claims for the initiators as well (#473) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jürgen Eckel --- util/rddl_token_test.go | 7 +++++++ x/dao/keeper/msg_server_distribution_result.go | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/util/rddl_token_test.go b/util/rddl_token_test.go index f4e7605..6838b45 100644 --- a/util/rddl_token_test.go +++ b/util/rddl_token_test.go @@ -10,6 +10,13 @@ const ( rddlTokenAmount string = "998.85844748" ) +func Test2FloatConvertion1RDDL(t *testing.T) { + t.Parallel() + var expectedValue uint64 = 100000000 + value := RDDLToken2Uint(1) + assert.Equal(t, expectedValue, value) +} + func Test2FloatConvertion(t *testing.T) { t.Parallel() var expectedValue uint64 = 99885844748 diff --git a/x/dao/keeper/msg_server_distribution_result.go b/x/dao/keeper/msg_server_distribution_result.go index 814a409..d82e2ef 100644 --- a/x/dao/keeper/msg_server_distribution_result.go +++ b/x/dao/keeper/msg_server_distribution_result.go @@ -67,6 +67,10 @@ func (k msgServer) clearUnresolvedClaims(ctx sdk.Context, start int64) (err erro currentAmounts[address] += amount } + for address, amount := range claims.initiator { + currentAmounts[address] += amount + } + totalAmounts := make(map[string]uint64) for participantAddress := range currentAmounts { stagedBalance := k.bankKeeper.GetBalance(ctx, sdk.MustAccAddressFromBech32(participantAddress), k.GetParams(ctx).StagedDenom)