Merge PR #4881: Linting Galore

This commit is contained in:
Marko
2019-08-19 12:06:27 -04:00
committed by Alexander Bezobchuk
parent 89b1220398
commit 3a4f1fc4d4
75 changed files with 209 additions and 284 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import (
// ErrInvalidAccount returns a standardized error reflecting that a given
// account address does not exist.
func ErrInvalidAccount(addr sdk.AccAddress) error {
return fmt.Errorf(`No account with address %s was found in the state.
return fmt.Errorf(`no account with address %s was found in the state.
Are you sure there has been a transaction involving it?`, addr)
}
@@ -17,6 +17,6 @@ Are you sure there has been a transaction involving it?`, addr)
// height can't be verified. The reason is that the base checkpoint of the certifier is
// newer than the given height
func ErrVerifyCommit(height int64) error {
return fmt.Errorf(`The height of base truststore in the light client is higher than height %d.
return fmt.Errorf(`the height of base truststore in the light client is higher than height %d.
Can't verify blockchain proof at this height. Please set --trust-node to true and try again`, height)
}
+2 -2
View File
@@ -215,7 +215,7 @@ func runAddCmd(cmd *cobra.Command, args []string) error {
return err
}
mnemonic, err = bip39.NewMnemonic(entropySeed[:])
mnemonic, err = bip39.NewMnemonic(entropySeed)
if err != nil {
return err
}
@@ -295,7 +295,7 @@ func printCreate(cmd *cobra.Command, info keys.Info, showMnemonic bool, mnemonic
}
cmd.PrintErrln(string(jsonString))
default:
return fmt.Errorf("I can't speak: %s", output)
return fmt.Errorf("invalid output format %s", output)
}
return nil
+5 -5
View File
@@ -47,12 +47,12 @@ func TestMarshalJSON(t *testing.T) {
want []byte
wantErr bool
}{
{"basic", args{data.Keys[0]}, []byte(data.JSON[0]), false},
{"mnemonic is optional", args{data.Keys[1]}, []byte(data.JSON[1]), false},
{"basic", args{data.Keys[0]}, data.JSON[0], false},
{"mnemonic is optional", args{data.Keys[1]}, data.JSON[1], false},
// REVIEW: Are the next results expected??
{"empty name", args{data.Keys[2]}, []byte(data.JSON[2]), false},
{"empty object", args{data.Keys[3]}, []byte(data.JSON[3]), false},
{"empty name", args{data.Keys[2]}, data.JSON[2], false},
{"empty object", args{data.Keys[3]}, data.JSON[3], false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@@ -92,7 +92,7 @@ func TestUnmarshalJSON(t *testing.T) {
for idx, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := UnmarshalJSON(tt.args.bz, tt.args.ptr); (err != nil) != tt.wantErr {
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
t.Errorf("unmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
}
// Confirm deserialized objects are the same
+1 -1
View File
@@ -65,7 +65,7 @@ func runMnemonicCmd(cmd *cobra.Command, args []string) error {
}
}
mnemonic, err := bip39.NewMnemonic(entropySeed[:])
mnemonic, err := bip39.NewMnemonic(entropySeed)
if err != nil {
return err
}
+1 -1
View File
@@ -69,7 +69,7 @@ func ReadPassphraseFromStdin(name string) (string, error) {
passphrase, err := input.GetPassword(prompt, buf)
if err != nil {
return passphrase, fmt.Errorf("Error reading passphrase: %v", err)
return passphrase, fmt.Errorf("error reading passphrase: %v", err)
}
return passphrase, nil