Skip to content

Commit

Permalink
fixed linter issues and addressed reviewers comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberbono3 committed Mar 29, 2021
1 parent fe12325 commit fc5b76a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
5 changes: 0 additions & 5 deletions client/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ func ReadPersistentCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Cont
clientCtx = clientCtx.WithOutputFormat(output)
}

if clientCtx.HomeDir == "" || flagSet.Changed(flags.FlagHome) {
homeDir, _ := flagSet.GetString(flags.FlagHome)
clientCtx = clientCtx.WithHomeDir(homeDir)
}

if !clientCtx.Simulate || flagSet.Changed(flags.FlagDryRun) {
dryRun, _ := flagSet.GetBool(flags.FlagDryRun)
clientCtx = clientCtx.WithSimulation(dryRun)
Expand Down
1 change: 0 additions & 1 deletion client/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func ReadFromClientConfig(ctx client.Context) (client.Context, error) {
}
// we need to update KeyringDir field on Client Context first cause it is used in NewKeyringFromBackend
ctx = ctx.WithOutputFormat(conf.Output).
WithKeyringDir(ctx.HomeDir).
WithChainID(conf.ChainID)

keyring, err := client.NewKeyringFromBackend(ctx, conf.KeyringBackend)
Expand Down
6 changes: 5 additions & 1 deletion client/config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ const defaultConfigTemplate = `# This is a TOML config file.
### Client Configuration ###
###############################################################################
# The network chain ID
chain-id = "{{ .ChainID }}"
# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory)
keyring-backend = "{{ .KeyringBackend }}"
# CLI output format (text|json)
output = "{{ .Output }}"
# <host>:<port> to Tendermint RPC interface for this chain
node = "{{ .Node }}"
# Transaction broadcasting mode (sync|async|block)
broadcast-mode = "{{ .BroadcastMode }}"
`

Expand Down
1 change: 1 addition & 0 deletions client/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ func GetFromFields(kr keyring.Keyring, from string, genOnly bool) (sdk.AccAddres
return info.GetAddress(), info.GetName(), info.GetType(), nil
}

// NewKeyringFromBackend gets a Keyring object from a backend
func NewKeyringFromBackend(ctx Context, backend string) (keyring.Keyring, error) {
if ctx.GenerateOnly || ctx.Simulate {
return keyring.New(sdk.KeyringServiceName(), keyring.BackendMemory, ctx.KeyringDir, ctx.Input, ctx.KeyringOptions...)
Expand Down
2 changes: 1 addition & 1 deletion client/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package client

import (
"github.com/spf13/pflag"

rpchttp "github.com/tendermint/tendermint/rpc/client/http"

"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down Expand Up @@ -74,6 +73,7 @@ func ReadPageRequest(flagSet *pflag.FlagSet) (*query.PageRequest, error) {

// NewClientFromNode sets up Client implementation that communicates with a Tendermint node over
// JSON RPC and WebSockets
// TODO: We might not need to manually append `/websocket`:
// https://github.com/cosmos/cosmos-sdk/issues/8986
func NewClientFromNode(nodeURI string) (*rpchttp.HTTP, error) {
return rpchttp.New(nodeURI, "/websocket")
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapK
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
Expand Down
3 changes: 2 additions & 1 deletion server/rosetta/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (c converter) Tx(rawTx tmtypes.Tx, txResult *abci.ResponseDeliverTx) (*rose
}
// get operations from msgs
msgs := tx.GetMsgs()

//nolint: prealloc
var rawTxOps []*rosettatypes.Operation
for _, msg := range msgs {
ops, err := c.Ops(status, msg)
Expand All @@ -339,6 +339,7 @@ func (c converter) Tx(rawTx tmtypes.Tx, txResult *abci.ResponseDeliverTx) (*rose
}

func (c converter) BalanceOps(status string, events []abci.Event) []*rosettatypes.Operation {
//nolint: prealloc
var ops []*rosettatypes.Operation

for _, e := range events {
Expand Down

0 comments on commit fc5b76a

Please sign in to comment.