File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,26 @@ func TestBRC42PrivateVectors(t *testing.T) {
116116 }
117117}
118118
119+ func TestPrivateKeyFromInvalidHex (t * testing.T ) {
120+ hex := ""
121+ _ , err := PrivateKeyFromHex (hex )
122+ require .Error (t , err )
123+
124+ wif := "L4o1GXuUSHauk19f9Cfpm1qfSXZuGLBUAC2VZM6vdmfMxRxAYkWq"
125+ _ , err = PrivateKeyFromHex (wif )
126+ require .Error (t , err )
127+ }
128+
129+ func TestPrivateKeyFromInvalidWif (t * testing.T ) {
130+ wif := "L401GXuUSHauk19f9Cfpm1qfSXZuGLBUAC2VZM6vdmfMxRxAYkWq"
131+ _ , err := PrivateKeyFromWif (wif )
132+ require .Error (t , err )
133+
134+ wif = "L4o1GXuUSHauk19f9Cfpm1qfSXZuGLBUAC2VZM6vdmfMxRxAYkW"
135+ _ , err = PrivateKeyFromWif (wif )
136+ require .Error (t , err )
137+ }
138+
119139// TestPolynomialFromPrivateKey checks if a polynomial is correctly created from a private key
120140func TestPolynomialFromPrivateKey (t * testing.T ) {
121141
You can’t perform that action at this time.
0 commit comments