mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-11-24 14:35:47 +00:00
chore: log in case of error
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
This commit is contained in:
parent
b8433d4279
commit
e3ac596bd6
@ -1,6 +1,7 @@
|
||||
package errormsg
|
||||
|
||||
var (
|
||||
ErrorInvalidCreator = "invalid creator address (%s)"
|
||||
InvalidRequest = "invalid request"
|
||||
CouldNotGetValidatorIdentity = "could not get validator identity"
|
||||
ErrorInvalidCreator = "invalid creator address (%s)"
|
||||
InvalidRequest = "invalid request"
|
||||
)
|
||||
|
||||
@ -5,6 +5,7 @@ import (
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/planetmint/planetmint-go/errormsg"
|
||||
"github.com/planetmint/planetmint-go/util"
|
||||
"github.com/planetmint/planetmint-go/x/dao/types"
|
||||
)
|
||||
@ -30,6 +31,7 @@ func (k msgServer) DistributionRequest(goCtx context.Context, msg *types.MsgDist
|
||||
|
||||
validatorIdentity, err := util.GetValidatorCometBFTIdentity(ctx, k.RootDir)
|
||||
if err != nil {
|
||||
util.GetAppLogger().Error(ctx, distributionRequestTag+errormsg.CouldNotGetValidatorIdentity+": "+err.Error())
|
||||
return nil, err
|
||||
}
|
||||
if msg.Distribution.GetProposer() != validatorIdentity {
|
||||
|
||||
@ -4,10 +4,15 @@ import (
|
||||
"context"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/planetmint/planetmint-go/errormsg"
|
||||
"github.com/planetmint/planetmint-go/util"
|
||||
"github.com/planetmint/planetmint-go/x/dao/types"
|
||||
)
|
||||
|
||||
var (
|
||||
initPopTag = "init pop tag: "
|
||||
)
|
||||
|
||||
func (k msgServer) InitPop(goCtx context.Context, msg *types.MsgInitPop) (*types.MsgInitPopResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
|
||||
@ -21,6 +26,7 @@ func (k msgServer) InitPop(goCtx context.Context, msg *types.MsgInitPop) (*types
|
||||
|
||||
validatorIdentity, err := util.GetValidatorCometBFTIdentity(ctx, k.RootDir)
|
||||
if err != nil {
|
||||
util.GetAppLogger().Error(ctx, initPopTag+errormsg.CouldNotGetValidatorIdentity+": "+err.Error())
|
||||
return nil, err
|
||||
}
|
||||
if msg.Initiator == validatorIdentity {
|
||||
|
||||
@ -5,6 +5,7 @@ import (
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/planetmint/planetmint-go/errormsg"
|
||||
"github.com/planetmint/planetmint-go/util"
|
||||
"github.com/planetmint/planetmint-go/x/dao/types"
|
||||
)
|
||||
@ -31,6 +32,7 @@ func (k msgServer) ReissueRDDLProposal(goCtx context.Context, msg *types.MsgReis
|
||||
|
||||
validatorIdentity, err := util.GetValidatorCometBFTIdentity(ctx, k.RootDir)
|
||||
if err != nil {
|
||||
util.GetAppLogger().Error(ctx, reissueTag+errormsg.CouldNotGetValidatorIdentity+": "+err.Error())
|
||||
return nil, err
|
||||
}
|
||||
if msg.Proposer != validatorIdentity {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user