Squash various linter warnings (#5652)

Closes: #5651
This commit is contained in:
Alessio Treglia
2020-02-16 20:06:45 +01:00
committed by GitHub
parent 05c21a534a
commit c77bb7b038
6 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ const (
)
// ExportCmd dumps app state to JSON.
func ExportCmd(ctx *Context, cdc *codec.Codec, appExporter AppExporter) *cobra.Command {
func ExportCmd(ctx *Context, cdc codec.JSONMarshaler, appExporter AppExporter) *cobra.Command {
cmd := &cobra.Command{
Use: "export",
Short: "Export state to JSON",
+2 -2
View File
@@ -118,7 +118,7 @@ func interceptLoadConfig() (conf *cfg.Config, err error) {
// add server commands
func AddCommands(
ctx *Context, cdc *codec.Codec,
ctx *Context, cdc codec.JSONMarshaler,
rootCmd *cobra.Command,
appCreator AppCreator, appExport AppExporter) {
@@ -154,7 +154,7 @@ func AddCommands(
//
// NOTE: The ordering of the keys returned as the resulting JSON message is
// non-deterministic, so the client should not rely on key ordering.
func InsertKeyJSON(cdc *codec.Codec, baseJSON []byte, key string, value json.RawMessage) ([]byte, error) {
func InsertKeyJSON(cdc codec.JSONMarshaler, baseJSON []byte, key string, value json.RawMessage) ([]byte, error) {
var jsonMap map[string]json.RawMessage
if err := cdc.UnmarshalJSON(baseJSON, &jsonMap); err != nil {
+1 -1
View File
@@ -24,7 +24,7 @@ func Test_validateAuxFuncs(t *testing.T) {
{"two dec", args{sdk.NewDec(2)}, true},
}
for _, tt := range tests {
tt = tt
tt := tt
t.Run(tt.name, func(t *testing.T) {
require.Equal(t, tt.wantErr, validateCommunityTax(tt.args.i) != nil)
require.Equal(t, tt.wantErr, validateBaseProposerReward(tt.args.i) != nil)
+2 -2
View File
@@ -48,7 +48,7 @@ func newPrintInfo(moniker, chainID, nodeID, genTxsDir string,
}
}
func displayInfo(cdc *codec.Codec, info printInfo) error {
func displayInfo(cdc codec.JSONMarshaler, info printInfo) error {
out, err := codec.MarshalJSONIndent(cdc, info)
if err != nil {
return err
@@ -60,7 +60,7 @@ func displayInfo(cdc *codec.Codec, info printInfo) error {
// InitCmd returns a command that initializes all files needed for Tendermint
// and the respective application.
func InitCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager,
func InitCmd(ctx *server.Context, cdc codec.JSONMarshaler, mbm module.BasicManager,
defaultNodeHome string) *cobra.Command { // nolint: golint
cmd := &cobra.Command{
Use: "init [moniker]",
-1
View File
@@ -20,7 +20,6 @@ import (
var (
priv1 = secp256k1.GenPrivKey()
addr1 = sdk.AccAddress(priv1.PubKey().Address())
coins = sdk.Coins{sdk.NewInt64Coin("foocoin", 10)}
)
func checkValidator(t *testing.T, app *simapp.SimApp, addr sdk.AccAddress, expFound bool) staking.Validator {
+2 -2
View File
@@ -49,11 +49,11 @@ func TestStakingMsgs(t *testing.T) {
acc2 := &auth.BaseAccount{Address: addr2}
accs := authexported.GenesisAccounts{acc1, acc2}
balances := []bank.Balance{
bank.Balance{
{
Address: addr1,
Coins: sdk.Coins{genCoin},
},
bank.Balance{
{
Address: addr2,
Coins: sdk.Coins{genCoin},
},