Skip to content

Commit

Permalink
[eth][tests] Add test for WalletsDirectory.GetWallet method
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricio1802 committed Mar 8, 2020
1 parent 01d96ac commit 254f178
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/coin/ethereum/models/wallet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,21 @@ func TestWalletDirectoryListWallet(t *testing.T) {
require.NotNil(t, wlt)
require.Equal(t, "test", wlt.GetLabel())
}

func TestWalletDirectoryGetWallet(t *testing.T) {
wltDir, err := NewWalletDirectory("testdata")
require.Nil(t, err)

wlt, err := wltDir.GetWallet("wrong_wallet_id")
require.EqualError(t, err, errors.ErrNotFound.Error())

var origWlt *KeystoreWallet
for _, sWlt := range wltDir.wallets {
origWlt = sWlt
}

wlt, err = wltDir.GetWallet(origWlt.GetId())
require.Nil(t, err)

require.Equal(t, origWlt, wlt)
}

0 comments on commit 254f178

Please sign in to comment.