gpu-compute-chain/x/colinearcore/types/message_unlock_all_funds_te...

41 lines
747 B
Go
Raw Normal View History

2022-09-08 16:29:08 -07:00
package types
import (
"testing"
"colinear/testutil/sample"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/stretchr/testify/require"
)
func TestMsgUnlockAllFunds_ValidateBasic(t *testing.T) {
tests := []struct {
name string
msg MsgUnlockAllFunds
err error
}{
{
name: "invalid address",
msg: MsgUnlockAllFunds{
Creator: "invalid_address",
},
err: sdkerrors.ErrInvalidAddress,
}, {
name: "valid address",
msg: MsgUnlockAllFunds{
Creator: sample.AccAddress(),
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
err := tt.msg.ValidateBasic()
if tt.err != nil {
require.ErrorIs(t, err, tt.err)
return
}
require.NoError(t, err)
})
}
}