mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-11-25 06:55:46 +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
|
package errormsg
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrorInvalidCreator = "invalid creator address (%s)"
|
CouldNotGetValidatorIdentity = "could not get validator identity"
|
||||||
InvalidRequest = "invalid request"
|
ErrorInvalidCreator = "invalid creator address (%s)"
|
||||||
|
InvalidRequest = "invalid request"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import (
|
|||||||
|
|
||||||
errorsmod "cosmossdk.io/errors"
|
errorsmod "cosmossdk.io/errors"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/planetmint/planetmint-go/errormsg"
|
||||||
"github.com/planetmint/planetmint-go/util"
|
"github.com/planetmint/planetmint-go/util"
|
||||||
"github.com/planetmint/planetmint-go/x/dao/types"
|
"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)
|
validatorIdentity, err := util.GetValidatorCometBFTIdentity(ctx, k.RootDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
util.GetAppLogger().Error(ctx, distributionRequestTag+errormsg.CouldNotGetValidatorIdentity+": "+err.Error())
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if msg.Distribution.GetProposer() != validatorIdentity {
|
if msg.Distribution.GetProposer() != validatorIdentity {
|
||||||
|
|||||||
@ -4,10 +4,15 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/planetmint/planetmint-go/errormsg"
|
||||||
"github.com/planetmint/planetmint-go/util"
|
"github.com/planetmint/planetmint-go/util"
|
||||||
"github.com/planetmint/planetmint-go/x/dao/types"
|
"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) {
|
func (k msgServer) InitPop(goCtx context.Context, msg *types.MsgInitPop) (*types.MsgInitPopResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
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)
|
validatorIdentity, err := util.GetValidatorCometBFTIdentity(ctx, k.RootDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
util.GetAppLogger().Error(ctx, initPopTag+errormsg.CouldNotGetValidatorIdentity+": "+err.Error())
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if msg.Initiator == validatorIdentity {
|
if msg.Initiator == validatorIdentity {
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import (
|
|||||||
|
|
||||||
errorsmod "cosmossdk.io/errors"
|
errorsmod "cosmossdk.io/errors"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/planetmint/planetmint-go/errormsg"
|
||||||
"github.com/planetmint/planetmint-go/util"
|
"github.com/planetmint/planetmint-go/util"
|
||||||
"github.com/planetmint/planetmint-go/x/dao/types"
|
"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)
|
validatorIdentity, err := util.GetValidatorCometBFTIdentity(ctx, k.RootDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
util.GetAppLogger().Error(ctx, reissueTag+errormsg.CouldNotGetValidatorIdentity+": "+err.Error())
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if msg.Proposer != validatorIdentity {
|
if msg.Proposer != validatorIdentity {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user