mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-11-26 07:25:46 +00:00
removed some more code smell / error message aggregration
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
75ed13b357
commit
14241837d3
@ -67,7 +67,7 @@ func (s *AssetDistributionE2ETestSuite) TestAssetDistribution() {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
errmsg := "rpc error: code = NotFound desc = distribution not found: key not found"
|
||||
testCases := []struct {
|
||||
name string
|
||||
requestHeight int64
|
||||
@ -76,17 +76,17 @@ func (s *AssetDistributionE2ETestSuite) TestAssetDistribution() {
|
||||
{
|
||||
"request height too low",
|
||||
s.distributionOffset,
|
||||
"rpc error: code = NotFound desc = distribution not found: key not found",
|
||||
errmsg,
|
||||
},
|
||||
{
|
||||
"wrong request height",
|
||||
height,
|
||||
"rpc error: code = NotFound desc = distribution not found: key not found",
|
||||
errmsg,
|
||||
},
|
||||
{
|
||||
"request height too high",
|
||||
2*s.reissaunceEpochs + s.distributionOffset,
|
||||
"rpc error: code = NotFound desc = distribution not found: key not found",
|
||||
errmsg,
|
||||
},
|
||||
{
|
||||
"valid distribution request",
|
||||
|
||||
@ -24,6 +24,7 @@ func GetConnectFunc() mqtt.Token {
|
||||
|
||||
// GetDisconnectFunc fetches the mock client's `Disconnect` func
|
||||
func GetDisconnectFunc(_ uint) {
|
||||
// not implemented at this point in time
|
||||
}
|
||||
|
||||
// GetPublishFunc fetches the mock client's `Publish` func
|
||||
|
||||
@ -8,7 +8,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestMsgInitPop_ValidateBasic(t *testing.T) {
|
||||
func TestMsgInitPopValidateBasic(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
name string
|
||||
@ -16,7 +16,7 @@ func TestMsgInitPop_ValidateBasic(t *testing.T) {
|
||||
err error
|
||||
}{
|
||||
{
|
||||
name: "invalid address",
|
||||
name: sdkerrors.ErrInvalidAddress.Error(),
|
||||
msg: MsgInitPop{
|
||||
Creator: errormsg.ErrorInvalidAddress,
|
||||
},
|
||||
|
||||
@ -16,7 +16,7 @@ func TestMsgMintToken_ValidateBasic(t *testing.T) {
|
||||
err error
|
||||
}{
|
||||
{
|
||||
name: "invalid address",
|
||||
name: sdkerrors.ErrInvalidAddress.Error(),
|
||||
msg: MsgMintToken{
|
||||
Creator: errormsg.ErrorInvalidAddress,
|
||||
},
|
||||
|
||||
@ -16,7 +16,7 @@ func TestMsgUpdateParams_ValidateBasic(t *testing.T) {
|
||||
err error
|
||||
}{
|
||||
{
|
||||
name: "invalid address",
|
||||
name: sdkerrors.ErrInvalidAddress.Error(),
|
||||
msg: MsgUpdateParams{
|
||||
Authority: errormsg.ErrorInvalidAddress,
|
||||
},
|
||||
|
||||
@ -16,7 +16,7 @@ func TestMsgCreateRedeemClaim_ValidateBasic(t *testing.T) {
|
||||
err error
|
||||
}{
|
||||
{
|
||||
name: "invalid address",
|
||||
name: sdkerrors.ErrInvalidAddress.Error(),
|
||||
msg: MsgCreateRedeemClaim{
|
||||
Creator: errormsg.ErrorInvalidAddress,
|
||||
},
|
||||
@ -45,7 +45,7 @@ func TestMsgUpdateRedeemClaim_ValidateBasic(t *testing.T) {
|
||||
err error
|
||||
}{
|
||||
{
|
||||
name: "invalid address",
|
||||
name: sdkerrors.ErrInvalidAddress.Error(),
|
||||
msg: MsgUpdateRedeemClaim{
|
||||
Creator: errormsg.ErrorInvalidAddress,
|
||||
},
|
||||
@ -74,7 +74,7 @@ func TestMsgConfirmRedeemClaim_ValidateBasic(t *testing.T) {
|
||||
err error
|
||||
}{
|
||||
{
|
||||
name: "invalid address",
|
||||
name: sdkerrors.ErrInvalidAddress.Error(),
|
||||
msg: MsgConfirmRedeemClaim{
|
||||
Creator: errormsg.ErrorInvalidAddress,
|
||||
},
|
||||
|
||||
@ -16,7 +16,7 @@ func TestMsgAttestMachineValidateBasic(t *testing.T) {
|
||||
err error
|
||||
}{
|
||||
{
|
||||
name: "invalid address",
|
||||
name: sdkerrors.ErrInvalidAddress.Error(),
|
||||
msg: MsgAttestMachine{
|
||||
Creator: errormsg.ErrorInvalidAddress,
|
||||
},
|
||||
|
||||
@ -16,7 +16,7 @@ func TestMsgRegisterTrustAnchor_ValidateBasic(t *testing.T) {
|
||||
err error
|
||||
}{
|
||||
{
|
||||
name: "invalid address",
|
||||
name: sdkerrors.ErrInvalidAddress.Error(),
|
||||
msg: MsgRegisterTrustAnchor{
|
||||
Creator: errormsg.ErrorInvalidAddress,
|
||||
},
|
||||
|
||||
@ -16,7 +16,7 @@ func TestMsgUpdateParams_ValidateBasic(t *testing.T) {
|
||||
err error
|
||||
}{
|
||||
{
|
||||
name: "invalid address",
|
||||
name: sdkerrors.ErrInvalidAddress.Error(),
|
||||
msg: MsgUpdateParams{
|
||||
Authority: errormsg.ErrorInvalidAddress,
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user