diff options
author | Felix Lange <fjl@twurst.com> | 2015-03-08 07:35:23 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-03-08 07:35:23 +0800 |
commit | afc530ea411e18223b0323d7e11aa0fab9289d65 (patch) | |
tree | eaae979f2f1b78fd51a0c03e750544b96e27ef62 /accounts/accounts_test.go | |
parent | fda7b4c79d070f1cb4f5d7ef5b4d077d9dcf2774 (diff) | |
download | go-tangerine-afc530ea411e18223b0323d7e11aa0fab9289d65.tar.gz go-tangerine-afc530ea411e18223b0323d7e11aa0fab9289d65.tar.zst go-tangerine-afc530ea411e18223b0323d7e11aa0fab9289d65.zip |
accounts: use time.Duration correctly
There is no point to using time.Duration if the value is interpreted as
milliseconds. Callers should use the standard multiplication idiom to
choose the unit. In fact, the only caller outside of the tests already
does so.
Diffstat (limited to 'accounts/accounts_test.go')
-rw-r--r-- | accounts/accounts_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/accounts/accounts_test.go b/accounts/accounts_test.go index d8187220a..30e0b011a 100644 --- a/accounts/accounts_test.go +++ b/accounts/accounts_test.go @@ -12,7 +12,7 @@ import ( func TestAccountManager(t *testing.T) { ks := crypto.NewKeyStorePlain(ethutil.DefaultDataDir() + "/testaccounts") - am := NewAccountManager(ks, 100) + am := NewAccountManager(ks, 100*time.Millisecond) pass := "" // not used but required by API a1, err := am.NewAccount(pass) toSign := randentropy.GetEntropyCSPRNG(32) @@ -22,7 +22,7 @@ func TestAccountManager(t *testing.T) { } // Cleanup - time.Sleep(time.Millisecond * 150) // wait for locking + time.Sleep(150 * time.Millisecond) // wait for locking accounts, err := am.Accounts() if err != nil { @@ -38,7 +38,7 @@ func TestAccountManager(t *testing.T) { func TestAccountManagerLocking(t *testing.T) { ks := crypto.NewKeyStorePassphrase(ethutil.DefaultDataDir() + "/testaccounts") - am := NewAccountManager(ks, 200) + am := NewAccountManager(ks, 200*time.Millisecond) pass := "foo" a1, err := am.NewAccount(pass) toSign := randentropy.GetEntropyCSPRNG(32) @@ -62,7 +62,7 @@ func TestAccountManagerLocking(t *testing.T) { } // Signing without passphrase fails after automatic locking - time.Sleep(time.Millisecond * time.Duration(250)) + time.Sleep(250 * time.Millisecond) _, err = am.Sign(a1, toSign) if err != ErrLocked { |