removed some more code smell / error message aggregration

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2024-02-26 16:57:22 +01:00
parent 75ed13b357
commit 14241837d3
No known key found for this signature in database
9 changed files with 15 additions and 14 deletions

View File

@ -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",

View File

@ -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

View File

@ -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,
},

View File

@ -16,7 +16,7 @@ func TestMsgMintToken_ValidateBasic(t *testing.T) {
err error
}{
{
name: "invalid address",
name: sdkerrors.ErrInvalidAddress.Error(),
msg: MsgMintToken{
Creator: errormsg.ErrorInvalidAddress,
},

View File

@ -16,7 +16,7 @@ func TestMsgUpdateParams_ValidateBasic(t *testing.T) {
err error
}{
{
name: "invalid address",
name: sdkerrors.ErrInvalidAddress.Error(),
msg: MsgUpdateParams{
Authority: errormsg.ErrorInvalidAddress,
},

View File

@ -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,
},

View File

@ -16,7 +16,7 @@ func TestMsgAttestMachineValidateBasic(t *testing.T) {
err error
}{
{
name: "invalid address",
name: sdkerrors.ErrInvalidAddress.Error(),
msg: MsgAttestMachine{
Creator: errormsg.ErrorInvalidAddress,
},

View File

@ -16,7 +16,7 @@ func TestMsgRegisterTrustAnchor_ValidateBasic(t *testing.T) {
err error
}{
{
name: "invalid address",
name: sdkerrors.ErrInvalidAddress.Error(),
msg: MsgRegisterTrustAnchor{
Creator: errormsg.ErrorInvalidAddress,
},

View File

@ -16,7 +16,7 @@ func TestMsgUpdateParams_ValidateBasic(t *testing.T) {
err error
}{
{
name: "invalid address",
name: sdkerrors.ErrInvalidAddress.Error(),
msg: MsgUpdateParams{
Authority: errormsg.ErrorInvalidAddress,
},