|
|
@ -135,7 +135,7 @@ func TestCompressDecompress(t *testing.T) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func TestScannerValuer(t *testing.T) { |
|
|
|
func TestSignatureScannerValuer(t *testing.T) { |
|
|
|
privK := NewRandPrivKey() |
|
|
|
var value driver.Valuer |
|
|
|
var scan sql.Scanner |
|
|
@ -147,6 +147,21 @@ func TestScannerValuer(t *testing.T) { |
|
|
|
assert.Equal(t, value, scan) |
|
|
|
} |
|
|
|
|
|
|
|
func TestPubKeyScannerValuer(t *testing.T) { |
|
|
|
privKValue := NewRandPrivKey() |
|
|
|
pubKValue := privKValue.Public() |
|
|
|
privKScan := NewRandPrivKey() |
|
|
|
pubKScan := privKScan.Public() |
|
|
|
var value driver.Valuer |
|
|
|
var scan sql.Scanner |
|
|
|
value = pubKValue |
|
|
|
scan = pubKScan |
|
|
|
fromDB, err := value.Value() |
|
|
|
assert.NoError(t, err) |
|
|
|
assert.NoError(t, scan.Scan(fromDB)) |
|
|
|
assert.Equal(t, value, scan) |
|
|
|
} |
|
|
|
|
|
|
|
func BenchmarkBabyjubEddsa(b *testing.B) { |
|
|
|
var k PrivateKey |
|
|
|
_, err := hex.Decode(k[:], []byte("0001020304050607080900010203040506070809000102030405060708090001")) |
|
|
|