@@ -12,6 +12,7 @@ func TestNewWalletFromSeed(t *testing.T) {
1212 PublicKey string
1313 PrivateKey string
1414 ClassicAddress types.Address
15+ MasterAddress types.Address
1516 }{
1617 {
1718 Seed : "sEd7io6yt5dFJrcePgRiFVHvmkJhJD1" ,
@@ -31,10 +32,16 @@ func TestNewWalletFromSeed(t *testing.T) {
3132 PrivateKey : "ED2C0EAB27E1411DBB8FACC88D531A69967DA0E45AC7821A4041A5AEE24BB8FF29" ,
3233 ClassicAddress : "rs7cvHcsEF54DEs2y24Tpph3Xf71xUUrFu" ,
3334 },
35+ {
36+ Seed : "sh8i92YRnEjJy3fpFkL8txQSCVo79" ,
37+ PublicKey : "03AEEFE1E8ED4BBC009DE996AC03A8C6B5713B1554794056C66E5B8D1753C7DD0E" ,
38+ PrivateKey : "004265A28F3E18340A490421D47B2EB8DBC2C0BF2C24CEFEA971B61CED2CABD233" ,
39+ MasterAddress : "rUAi7pipxGpYfPNg3LtPcf2ApiS8aw9A93" ,
40+ },
3441 }
3542
3643 for _ , tc := range testCases {
37- wallet , err := FromSeed (tc .Seed , "" )
44+ wallet , err := FromSeed (tc .Seed , tc . MasterAddress . String () )
3845 if err != nil {
3946 t .Errorf ("Error generating wallet from seed: %s" , err )
4047 }
@@ -47,8 +54,14 @@ func TestNewWalletFromSeed(t *testing.T) {
4754 t .Errorf ("Private key does not match expected value. Expected: %s, got: %s" , tc .PrivateKey , wallet .PrivateKey )
4855 }
4956
50- if wallet .ClassicAddress != tc .ClassicAddress {
51- t .Errorf ("Classic address does not match expected value. Expected: %s, got: %s" , tc .ClassicAddress , wallet .ClassicAddress )
57+ if tc .MasterAddress != "" {
58+ if wallet .ClassicAddress != tc .MasterAddress {
59+ t .Errorf ("Classic address does not match expected value. Expected: %s, got: %s" , tc .MasterAddress , wallet .ClassicAddress )
60+ }
61+ } else {
62+ if wallet .ClassicAddress != tc .ClassicAddress {
63+ t .Errorf ("Classic address does not match expected value. Expected: %s, got: %s" , tc .ClassicAddress , wallet .ClassicAddress )
64+ }
5265 }
5366 }
5467}
0 commit comments