2020-11-05 20:55:25 +00:00
|
|
|
import {expect} from "chai";
|
2020-11-20 19:03:17 +00:00
|
|
|
import {IBls} from "../../src/interface";
|
2019-11-27 20:58:41 +00:00
|
|
|
|
2020-11-20 19:35:32 +00:00
|
|
|
export function runPublicKeyTests(bls: IBls): void {
|
2020-11-19 14:41:45 +00:00
|
|
|
describe("PublicKey", () => {
|
2019-11-27 20:58:41 +00:00
|
|
|
const publicKey =
|
2020-11-04 17:40:36 +00:00
|
|
|
"0xb6f21199594b56d77670564bf422cb331d5281ca2c1f9a45588a56881d8287ef8619efa6456d6cd2ef61306aa5b21311";
|
2019-11-27 20:58:41 +00:00
|
|
|
|
2020-11-19 14:41:45 +00:00
|
|
|
it("should export public key to hex string", () => {
|
|
|
|
expect(bls.PublicKey.fromHex(publicKey).toHex()).to.be.equal(publicKey);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should export public key to hex string from non-prefixed hex", () => {
|
2020-11-28 19:52:32 +00:00
|
|
|
expect(bls.PublicKey.fromHex(publicKey).toHex()).to.be.equal(publicKey);
|
2020-11-19 14:41:45 +00:00
|
|
|
});
|
2019-11-27 20:58:41 +00:00
|
|
|
|
2020-11-19 14:41:45 +00:00
|
|
|
it("from private key", () => {
|
|
|
|
bls.PrivateKey.fromKeygen().toPublicKey();
|
|
|
|
});
|
2019-11-27 20:58:41 +00:00
|
|
|
});
|
2020-11-20 19:03:17 +00:00
|
|
|
}
|