mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-03-30 15:08:28 +00:00
* fixed the cause for different results by different keepers during the processing of the distribution rewards. (#248)
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com> Co-authored-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
1d41d050fe
commit
926fc76659
@ -21,6 +21,9 @@ func (k msgServer) DistributionRequest(goCtx context.Context, msg *types.MsgDist
|
||||
return nil, errorsmod.Wrap(types.ErrReissuanceTxIDMissing, "for last reissuance height")
|
||||
}
|
||||
|
||||
util.GetAppLogger().Info(ctx, "distribution request: storing distribution")
|
||||
k.StoreDistributionOrder(ctx, *msg.GetDistribution())
|
||||
|
||||
validatorIdentity, validResult := util.GetValidatorCometBFTIdentity(ctx)
|
||||
if validResult && msg.Distribution.GetProposer() == validatorIdentity {
|
||||
util.GetAppLogger().Info(ctx, "distribution request: Entering Asset Distribution Mode")
|
||||
@ -43,8 +46,6 @@ func (k msgServer) DistributionRequest(goCtx context.Context, msg *types.MsgDist
|
||||
msg.Distribution.DaoTxID = daoTx
|
||||
util.SendDistributionResult(goCtx, msg.Distribution.LastPop, daoTx, investorTx, popTx)
|
||||
}
|
||||
util.GetAppLogger().Info(ctx, "distribution request: storing distribution")
|
||||
k.StoreDistributionOrder(ctx, *msg.GetDistribution())
|
||||
|
||||
return &types.MsgDistributionRequestResponse{}, nil
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/planetmint/planetmint-go/config"
|
||||
"github.com/planetmint/planetmint-go/util"
|
||||
@ -21,11 +20,13 @@ func (k msgServer) DistributionResult(goCtx context.Context, msg *types.MsgDistr
|
||||
distribution.InvestorTxID = msg.InvestorTxID
|
||||
err := k.resolveStagedClaims(ctx, distribution.FirstPop, distribution.LastPop)
|
||||
if err != nil {
|
||||
return nil, errorsmod.Wrapf(types.ErrResolvingStagedClaims, " for provided PoP heights: %d %d", distribution.FirstPop, distribution.LastPop)
|
||||
util.GetAppLogger().Error(ctx, "%s for provided PoP heights: %d %d", types.ErrResolvingStagedClaims.Error(), distribution.FirstPop, distribution.LastPop)
|
||||
} else {
|
||||
util.GetAppLogger().Info(ctx, "staged claims successfully for provided PoP heights: %d %d", distribution.FirstPop, distribution.LastPop)
|
||||
}
|
||||
k.StoreDistributionOrder(ctx, distribution)
|
||||
} else {
|
||||
return nil, errorsmod.Wrapf(types.ErrDistributionNotFound, " for provided block height %s", strconv.FormatInt(msg.GetLastPop(), 10))
|
||||
util.GetAppLogger().Error(ctx, "%s for provided block height %s", types.ErrDistributionNotFound.Error(), strconv.FormatInt(msg.GetLastPop(), 10))
|
||||
}
|
||||
|
||||
return &types.MsgDistributionResultResponse{}, nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user