navio-blsct
Version:
TypeScript bindings for the `libblsct` library used by the [Navio](https://nav.io/) blockchain to construct confidential transactions based on the BLS12-381 curve.
24 lines (19 loc) • 572 B
text/typescript
import { HashId } from '../hashId'
import { PublicKey } from '../keys/publicKey'
import { Scalar } from '../scalar'
test('generate', () => {
const blindingPubKey = PublicKey.random()
const spendingPubKey = PublicKey.random()
const viewKey = Scalar.random()
HashId.generate(blindingPubKey, spendingPubKey, viewKey)
})
test('random', () => {
HashId.random()
})
test('serialize and deserialize', () => {
const a = HashId.random()
const a_hex = a.serialize()
const b = HashId.deserialize(a_hex)
const b_hex = b.serialize()
expect(a_hex).toBe(b_hex)
})