@@ -31,7 +31,7 @@ func Test_PrintVersion(t *testing.T) {
31
31
func Test_PathGeneration0 (t * testing.T ) {
32
32
bip32Path := []uint32 {44 , 100 , 0 , 0 , 0 }
33
33
34
- pathBytes , err := GetBip32bytes (bip32Path , 0 )
34
+ pathBytes , err := GetBip32bytesv1 (bip32Path , 0 )
35
35
36
36
if err != nil {
37
37
t .Fatalf ( "Detected error, err: %s\n " , err .Error ())
@@ -55,7 +55,7 @@ func Test_PathGeneration0(t *testing.T) {
55
55
func Test_PathGeneration2 (t * testing.T ) {
56
56
bip32Path := []uint32 {44 , 118 , 0 , 0 , 0 }
57
57
58
- pathBytes , err := GetBip32bytes (bip32Path , 2 )
58
+ pathBytes , err := GetBip32bytesv1 (bip32Path , 2 )
59
59
60
60
if err != nil {
61
61
t .Fatalf ("Detected error, err: %s\n " , err .Error ())
@@ -79,7 +79,7 @@ func Test_PathGeneration2(t *testing.T) {
79
79
func Test_PathGeneration3 (t * testing.T ) {
80
80
bip32Path := []uint32 {44 , 118 , 0 , 0 , 0 }
81
81
82
- pathBytes , err := GetBip32bytes (bip32Path , 3 )
82
+ pathBytes , err := GetBip32bytesv1 (bip32Path , 3 )
83
83
84
84
if err != nil {
85
85
t .Fatalf ("Detected error, err: %s\n " , err .Error ())
@@ -99,3 +99,75 @@ func Test_PathGeneration3(t *testing.T) {
99
99
fmt .Sprintf ("%x" , pathBytes ),
100
100
"Unexpected PathBytes\n " )
101
101
}
102
+
103
+ func Test_PathGeneration0v2 (t * testing.T ) {
104
+ bip32Path := []uint32 {44 , 100 , 0 , 0 , 0 }
105
+
106
+ pathBytes , err := GetBip32bytesv2 (bip32Path , 0 )
107
+
108
+ if err != nil {
109
+ t .Fatalf ( "Detected error, err: %s\n " , err .Error ())
110
+ }
111
+
112
+ fmt .Printf ("Path: %x\n " , pathBytes )
113
+
114
+ assert .Equal (
115
+ t ,
116
+ 40 ,
117
+ len (pathBytes ),
118
+ "PathBytes has wrong length: %x, expected length: %x\n " , pathBytes , 40 )
119
+
120
+ assert .Equal (
121
+ t ,
122
+ "2c000000640000000000000000000000000000000000000000000000000000000000000000000000" ,
123
+ fmt .Sprintf ("%x" , pathBytes ),
124
+ "Unexpected PathBytes\n " )
125
+ }
126
+
127
+ func Test_PathGeneration2v2 (t * testing.T ) {
128
+ bip32Path := []uint32 {44 , 118 , 0 , 0 , 0 }
129
+
130
+ pathBytes , err := GetBip32bytesv2 (bip32Path , 2 )
131
+
132
+ if err != nil {
133
+ t .Fatalf ("Detected error, err: %s\n " , err .Error ())
134
+ }
135
+
136
+ fmt .Printf ("Path: %x\n " , pathBytes )
137
+
138
+ assert .Equal (
139
+ t ,
140
+ 40 ,
141
+ len (pathBytes ),
142
+ "PathBytes has wrong length: %x, expected length: %x\n " , pathBytes , 40 )
143
+
144
+ assert .Equal (
145
+ t ,
146
+ "2c000080760000800000000000000000000000000000000000000000000000000000000000000000" ,
147
+ fmt .Sprintf ("%x" , pathBytes ),
148
+ "Unexpected PathBytes\n " )
149
+ }
150
+
151
+ func Test_PathGeneration3v2 (t * testing.T ) {
152
+ bip32Path := []uint32 {44 , 118 , 0 , 0 , 0 }
153
+
154
+ pathBytes , err := GetBip32bytesv2 (bip32Path , 3 )
155
+
156
+ if err != nil {
157
+ t .Fatalf ("Detected error, err: %s\n " , err .Error ())
158
+ }
159
+
160
+ fmt .Printf ("Path: %x\n " , pathBytes )
161
+
162
+ assert .Equal (
163
+ t ,
164
+ 40 ,
165
+ len (pathBytes ),
166
+ "PathBytes has wrong length: %x, expected length: %x\n " , pathBytes , 40 )
167
+
168
+ assert .Equal (
169
+ t ,
170
+ "2c000080760000800000008000000000000000000000000000000000000000000000000000000000" ,
171
+ fmt .Sprintf ("%x" , pathBytes ),
172
+ "Unexpected PathBytes\n " )
173
+ }
0 commit comments