@@ -36,6 +36,9 @@ func TestIssue172(t *testing.T) {
36
36
37
37
// Derive the old (wrong way)
38
38
account , err := getWallet ().Derive (path , false )
39
+ if err != nil {
40
+ t .Error (err )
41
+ }
39
42
40
43
if account .Address .Hex () != "0x3943412CBEEEd4b68d73382b136F36b0CB82F481" {
41
44
t .Error ("wrong address" )
@@ -44,6 +47,10 @@ func TestIssue172(t *testing.T) {
44
47
// Set envar to non-zero length to derive correctly
45
48
os .Setenv (issue179FixEnvar , "1" )
46
49
account , err = getWallet ().Derive (path , false )
50
+ if err != nil {
51
+ t .Error (err )
52
+ }
53
+
47
54
if account .Address .Hex () != "0x98e440675eFF3041D20bECb7fE7e81746A431b6d" {
48
55
t .Error ("wrong address" )
49
56
}
@@ -53,6 +60,9 @@ func TestIssue172(t *testing.T) {
53
60
wallet := getWallet ()
54
61
wallet .SetFixIssue172 (true )
55
62
account , err = wallet .Derive (path , false )
63
+ if err != nil {
64
+ t .Error (err )
65
+ }
56
66
57
67
if account .Address .Hex () != "0x98e440675eFF3041D20bECb7fE7e81746A431b6d" {
58
68
t .Error ("wrong address" )
@@ -325,6 +335,8 @@ func TestWallet(t *testing.T) {
325
335
}
326
336
327
337
mnemonic , err = NewMnemonicFromEntropy (entropy )
338
+ _ = mnemonic
339
+
328
340
if err != nil {
329
341
t .Error (err )
330
342
}
@@ -333,3 +345,25 @@ func TestWallet(t *testing.T) {
333
345
t .Error ("expected 12 words" )
334
346
}
335
347
}
348
+
349
+ func TestWalletWithPassword (t * testing.T ) {
350
+ mnemonic := "tag volcano eight thank tide danger coast health above argue embrace heavy"
351
+ wallet , err := NewFromMnemonic (mnemonic , "mysecret" )
352
+ if err != nil {
353
+ t .Error (err )
354
+ }
355
+
356
+ path , err := ParseDerivationPath ("m/44'/60'/0'/0/0" )
357
+ if err != nil {
358
+ t .Error (err )
359
+ }
360
+
361
+ account , err := wallet .Derive (path , false )
362
+ if err != nil {
363
+ t .Error (err )
364
+ }
365
+
366
+ if account .Address .Hex () != "0x2C0572B541D72F7078A28597fE8b1997437E885a" {
367
+ t .Error ("wrong address" )
368
+ }
369
+ }
0 commit comments