mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-11-27 07:48:29 +00:00
linter pleasure
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
6fe2ab643e
commit
2696a52a53
@ -1,6 +1,7 @@
|
|||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
errorsmod "cosmossdk.io/errors"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||||
)
|
)
|
||||||
@ -40,7 +41,7 @@ func (msg *MsgUpdateParams) GetSignBytes() []byte {
|
|||||||
func (msg *MsgUpdateParams) ValidateBasic() error {
|
func (msg *MsgUpdateParams) ValidateBasic() error {
|
||||||
_, err := sdk.AccAddressFromBech32(msg.Authority)
|
_, err := sdk.AccAddressFromBech32(msg.Authority)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid authority address (%s)", err)
|
return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid authority address (%s)", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,11 +4,11 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||||
"github.com/planetmint/planetmint-go/testutil/sample"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMsgUpdateParams_ValidateBasic(t *testing.T) {
|
func TestMsgUpdateParams_ValidateBasic(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
msg MsgUpdateParams
|
msg MsgUpdateParams
|
||||||
@ -20,15 +20,12 @@ func TestMsgUpdateParams_ValidateBasic(t *testing.T) {
|
|||||||
Authority: "invalid_address",
|
Authority: "invalid_address",
|
||||||
},
|
},
|
||||||
err: sdkerrors.ErrInvalidAddress,
|
err: sdkerrors.ErrInvalidAddress,
|
||||||
}, {
|
|
||||||
name: "valid address",
|
|
||||||
msg: MsgUpdateParams{
|
|
||||||
Authority: sample.AccAddress(),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
tt := tt
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
err := tt.msg.ValidateBasic()
|
err := tt.msg.ValidateBasic()
|
||||||
if tt.err != nil {
|
if tt.err != nil {
|
||||||
require.ErrorIs(t, err, tt.err)
|
require.ErrorIs(t, err, tt.err)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user