UNPKG

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) 603 B
import { HashId } from '../hashId' import { PublicKey } from '../keys/publicKey' import { ViewKey } from '../keys/childKeyDesc/txKeyDesc/viewKey' test('generate', () => { const blindingPubKey = PublicKey.random() const spendingPubKey = PublicKey.random() const viewKey = ViewKey.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) })