diff --git a/x/bond/keeper/keeper.go b/x/bond/keeper/keeper.go index 0327678b..1211fd14 100644 --- a/x/bond/keeper/keeper.go +++ b/x/bond/keeper/keeper.go @@ -130,7 +130,7 @@ func (k Keeper) CreateBond(ctx sdk.Context, ownerAddress sdk.AccAddress, coins s bond := types.Bond{Id: bondID, Owner: ownerAddress.String(), Balance: coins} if bond.Balance.IsAnyGT(maxBondAmount) { - return nil, errors.Wrap(sdkerrors.ErrInvalidRequest, "Max bond amount exceeded") + return nil, errors.Wrap(sdkerrors.ErrInvalidRequest, "max bond amount exceeded") } // Move funds into the bond account module. @@ -331,7 +331,7 @@ func (k Keeper) GetBondModuleBalances(ctx sdk.Context) sdk.Coins { // TransferCoinsToModuleAccount moves funds from the bonds module account to another module account. func (k Keeper) TransferCoinsToModuleAccount(ctx sdk.Context, id, moduleAccount string, coins sdk.Coins) error { if !k.HasBond(ctx, id) { - return errors.Wrap(sdkerrors.ErrUnauthorized, "Bond not found.") + return errors.Wrap(sdkerrors.ErrUnauthorized, "bond not found") } bondObj := k.GetBond(ctx, id) diff --git a/x/bond/types/msg.go b/x/bond/types/msg.go index 26dde02d..b04b93ce 100644 --- a/x/bond/types/msg.go +++ b/x/bond/types/msg.go @@ -32,7 +32,7 @@ func (msg MsgCreateBond) ValidateBasic() error { return errors.Wrap(sdkerrors.ErrInvalidAddress, msg.Signer) } if len(msg.Coins) == 0 || !msg.Coins.IsValid() { - return errors.Wrap(sdkerrors.ErrInvalidCoins, "Invalid amount.") + return errors.Wrap(sdkerrors.ErrInvalidCoins, "invalid amount") } return nil } @@ -71,7 +71,7 @@ func (msg MsgRefillBond) ValidateBasic() error { return errors.Wrap(sdkerrors.ErrInvalidAddress, msg.Signer) } if len(msg.Coins) == 0 || !msg.Coins.IsValid() { - return errors.Wrap(sdkerrors.ErrInvalidCoins, "Invalid amount.") + return errors.Wrap(sdkerrors.ErrInvalidCoins, "invalid amount") } return nil } @@ -110,7 +110,7 @@ func (msg MsgWithdrawBond) ValidateBasic() error { return errors.Wrap(sdkerrors.ErrInvalidAddress, msg.Signer) } if len(msg.Coins) == 0 || !msg.Coins.IsValid() { - return errors.Wrap(sdkerrors.ErrInvalidCoins, "Invalid amount.") + return errors.Wrap(sdkerrors.ErrInvalidCoins, "invalid amount") } return nil } diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index 480144b9..98008b32 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -241,7 +241,7 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*type resourceSignBytes, _ := record.GetSignBytes() cid, err := record.GetCID() if err != nil { - return nil, errors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid record JSON") + return nil, errors.Wrap(sdkerrors.ErrInvalidRequest, "invalid record JSON") } record.ID = cid @@ -256,13 +256,13 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*type pubKey, err := legacy.PubKeyFromBytes(helpers.BytesFromBase64(sig.PubKey)) if err != nil { fmt.Println("Error decoding pubKey from bytes: ", err) - return nil, errors.Wrap(sdkerrors.ErrUnauthorized, "Invalid public key.") + return nil, errors.Wrap(sdkerrors.ErrUnauthorized, "invalid public key") } sigOK := pubKey.VerifySignature(resourceSignBytes, helpers.BytesFromBase64(sig.Sig)) if !sigOK { fmt.Println("Signature mismatch: ", sig.PubKey) - return nil, errors.Wrap(sdkerrors.ErrUnauthorized, "Invalid signature.") + return nil, errors.Wrap(sdkerrors.ErrUnauthorized, "invalid signature") } record.Owners = append(record.Owners, pubKey.Address().String()) }