diff options
author | Felix Lange <fjl@twurst.com> | 2016-03-03 07:46:56 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-04-12 21:56:49 +0800 |
commit | 4e6d8b348d864c8af74e0aca114bf730e42a160a (patch) | |
tree | eca8056c836109c0b63a81616bc7c9297a198f9b /accounts | |
parent | 85e6c40c0081bd0db80448640db648887804010c (diff) | |
download | dexon-4e6d8b348d864c8af74e0aca114bf730e42a160a.tar dexon-4e6d8b348d864c8af74e0aca114bf730e42a160a.tar.gz dexon-4e6d8b348d864c8af74e0aca114bf730e42a160a.tar.bz2 dexon-4e6d8b348d864c8af74e0aca114bf730e42a160a.tar.lz dexon-4e6d8b348d864c8af74e0aca114bf730e42a160a.tar.xz dexon-4e6d8b348d864c8af74e0aca114bf730e42a160a.tar.zst dexon-4e6d8b348d864c8af74e0aca114bf730e42a160a.zip |
accounts: fix go vet warnings
Diffstat (limited to 'accounts')
-rw-r--r-- | accounts/accounts_test.go | 2 | ||||
-rw-r--r-- | accounts/key_store_passphrase.go | 4 | ||||
-rw-r--r-- | accounts/key_store_passphrase_test.go | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/accounts/accounts_test.go b/accounts/accounts_test.go index 02dd74c8a..4a1d1b848 100644 --- a/accounts/accounts_test.go +++ b/accounts/accounts_test.go @@ -120,7 +120,7 @@ func TestSignRace(t *testing.T) { } if err := am.TimedUnlock(a1.Address, "", 15*time.Millisecond); err != nil { - t.Fatalf("could not unlock the test account", err) + t.Fatal("could not unlock the test account", err) } end := time.Now().Add(500 * time.Millisecond) for time.Now().Before(end) { diff --git a/accounts/key_store_passphrase.go b/accounts/key_store_passphrase.go index cb00b90af..3ee86588e 100644 --- a/accounts/key_store_passphrase.go +++ b/accounts/key_store_passphrase.go @@ -295,13 +295,13 @@ func getKDFKey(cryptoJSON cryptoJSON, auth string) ([]byte, error) { c := ensureInt(cryptoJSON.KDFParams["c"]) prf := cryptoJSON.KDFParams["prf"].(string) if prf != "hmac-sha256" { - return nil, fmt.Errorf("Unsupported PBKDF2 PRF: ", prf) + return nil, fmt.Errorf("Unsupported PBKDF2 PRF: %s", prf) } key := pbkdf2.Key(authArray, salt, c, dkLen, sha256.New) return key, nil } - return nil, fmt.Errorf("Unsupported KDF: ", cryptoJSON.KDF) + return nil, fmt.Errorf("Unsupported KDF: %s", cryptoJSON.KDF) } // TODO: can we do without this when unmarshalling dynamic JSON? diff --git a/accounts/key_store_passphrase_test.go b/accounts/key_store_passphrase_test.go index afa751d44..6ff3ae422 100644 --- a/accounts/key_store_passphrase_test.go +++ b/accounts/key_store_passphrase_test.go @@ -32,7 +32,7 @@ func TestKeyEncryptDecrypt(t *testing.T) { for i := 0; i < 3; i++ { // Try a bad password first if _, err := DecryptKey(keyjson, password+"bad"); err == nil { - t.Error("test %d: json key decrypted with bad password", i) + t.Errorf("test %d: json key decrypted with bad password", i) } // Decrypt with the correct password key, err := DecryptKey(keyjson, password) @@ -45,7 +45,7 @@ func TestKeyEncryptDecrypt(t *testing.T) { // Recrypt with a new password and start over password += "new data appended" if keyjson, err = EncryptKey(key, password, LightScryptN, LightScryptP); err != nil { - t.Errorf("test %d: failed to recrypt key %v", err) + t.Errorf("test %d: failed to recrypt key %v", i, err) } } } |