remove extra lines & rename whisper service var

This commit is contained in:
Caner Çıdam 2017-12-19 15:19:40 +03:00 committed by Frank Mueller
parent f15d16ba1e
commit 6ce30e158b
1 changed files with 5 additions and 7 deletions

View File

@ -149,7 +149,6 @@ func TestCreateAndRecoverAccountSuccess(t *testing.T) {
nodeManager.EXPECT().AccountKeyStore().Return(keyStore, nil) nodeManager.EXPECT().AccountKeyStore().Return(keyStore, nil)
addr1, pubKey1, mnemonic, err := accManager.CreateAccount(password) addr1, pubKey1, mnemonic, err := accManager.CreateAccount(password)
require.NoError(t, err) require.NoError(t, err)
require.NotNil(t, addr1) require.NotNil(t, addr1)
require.NotNil(t, pubKey1) require.NotNil(t, pubKey1)
require.NotNil(t, mnemonic) require.NotNil(t, mnemonic)
@ -158,7 +157,6 @@ func TestCreateAndRecoverAccountSuccess(t *testing.T) {
nodeManager.EXPECT().AccountKeyStore().Return(keyStore, nil) nodeManager.EXPECT().AccountKeyStore().Return(keyStore, nil)
addr2, pubKey2, err := accManager.RecoverAccount(password, mnemonic) addr2, pubKey2, err := accManager.RecoverAccount(password, mnemonic)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, addr1, addr2) require.Equal(t, addr1, addr2)
require.Equal(t, pubKey1, pubKey2) require.Equal(t, pubKey1, pubKey2)
} }
@ -198,7 +196,7 @@ func TestSelectAccount(t *testing.T) {
addr, _, _, err := accManager.CreateAccount(password) addr, _, _, err := accManager.CreateAccount(password)
require.NoError(t, err) require.NoError(t, err)
w := whisper.New(nil) shh := whisper.New(nil)
testCases := []struct { testCases := []struct {
name string name string
@ -211,7 +209,7 @@ func TestSelectAccount(t *testing.T) {
{ {
"success", "success",
[]interface{}{keyStore, nil}, []interface{}{keyStore, nil},
[]interface{}{w, nil}, []interface{}{shh, nil},
addr, addr,
password, password,
false, false,
@ -219,7 +217,7 @@ func TestSelectAccount(t *testing.T) {
{ {
"fail_keyStore", "fail_keyStore",
[]interface{}{nil, errors.New("Can't return you a key store")}, []interface{}{nil, errors.New("Can't return you a key store")},
[]interface{}{w, nil}, []interface{}{shh, nil},
addr, addr,
password, password,
true, true,
@ -235,7 +233,7 @@ func TestSelectAccount(t *testing.T) {
{ {
"fail_wrongAddress", "fail_wrongAddress",
[]interface{}{keyStore, nil}, []interface{}{keyStore, nil},
[]interface{}{w, nil}, []interface{}{shh, nil},
"wrong-address", "wrong-address",
password, password,
true, true,
@ -243,7 +241,7 @@ func TestSelectAccount(t *testing.T) {
{ {
"fail_wrongPassword", "fail_wrongPassword",
[]interface{}{keyStore, nil}, []interface{}{keyStore, nil},
[]interface{}{w, nil}, []interface{}{shh, nil},
addr, addr,
"wrong-password", "wrong-password",
true, true,