Skip to content

Commit

Permalink
Making GolintCI happy
Browse files Browse the repository at this point in the history
Signed-off-by: RiccardoM <riccardo.montagnin@gmail.com>
  • Loading branch information
RiccardoM committed Nov 21, 2019
1 parent 793a6c4 commit 1e0f46a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions x/posts/client/cli/tx.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cli

import (
"strconv"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/viper"
"strconv"

"github.com/spf13/cobra"

Expand Down Expand Up @@ -37,7 +38,7 @@ func GetTxCmd(_ string, cdc *codec.Codec) *cobra.Command {
}

var (
flagParentId = "parent-id"
flagParentID = "parent-id"
flagExternalReference = "external-reference"
)

Expand All @@ -63,7 +64,7 @@ func GetCmdCreatePost(cdc *codec.Codec) *cobra.Command {
return err
}

parentID, err := types.ParsePostID(viper.GetString(flagParentId))
parentID, err := types.ParsePostID(viper.GetString(flagParentID))
if err != nil {
return err
}
Expand All @@ -79,7 +80,7 @@ func GetCmdCreatePost(cdc *codec.Codec) *cobra.Command {
},
}

cmd.Flags().String(flagParentId, "0", "Id of the post to which this one should be an answer to")
cmd.Flags().String(flagParentID, "0", "Id of the post to which this one should be an answer to")
cmd.Flags().String(flagExternalReference, "", "External reference to this post")

return flags.GetCommands(cmd)[0]
Expand Down
8 changes: 4 additions & 4 deletions x/posts/internal/types/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,24 @@ func TestMsgCreatePost_GetSignBytes(t *testing.T) {
tests := []struct {
name string
msg types.MsgCreatePost
expSignJson string
expSignJSON string
}{
{
name: "Message with non-empty external reference",
msg: types.NewMsgCreatePost("My new post", types.PostID(53), false, "Ref#123", testOwner),
expSignJson: `{"type":"desmos/MsgCreatePost","value":{"allows_comments":false,"creator":"cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns","external_reference":"Ref#123","message":"My new post","parent_id":"53"}}`,
expSignJSON: `{"type":"desmos/MsgCreatePost","value":{"allows_comments":false,"creator":"cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns","external_reference":"Ref#123","message":"My new post","parent_id":"53"}}`,
},
{
name: "Message with non-empty external reference",
msg: types.NewMsgCreatePost("My post", types.PostID(15), false, "", testOwner),
expSignJson: `{"type":"desmos/MsgCreatePost","value":{"allows_comments":false,"creator":"cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns","external_reference":"","message":"My post","parent_id":"15"}}`,
expSignJSON: `{"type":"desmos/MsgCreatePost","value":{"allows_comments":false,"creator":"cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns","external_reference":"","message":"My post","parent_id":"15"}}`,
},
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
assert.Equal(t, test.expSignJson, string(test.msg.GetSignBytes()))
assert.Equal(t, test.expSignJSON, string(test.msg.GetSignBytes()))
})
}
}
Expand Down
3 changes: 2 additions & 1 deletion x/posts/internal/types/post_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package types_test

import (
"testing"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/desmos-labs/desmos/x/posts/internal/types"
"github.com/stretchr/testify/assert"
"testing"
)

// -----------
Expand Down

0 comments on commit 1e0f46a

Please sign in to comment.