This repository has been archived on 2023-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
chainsafe-bls/test/unit/context.test.ts

20 lines
534 B
TypeScript
Raw Normal View History

2020-11-04 17:40:36 +00:00
import { init, getContext, destroy } from "../../src/context";
import { expect } from "chai";
describe("bls wasm constext", function () {
afterEach(() => {
destroy();
});
it("initializes and works", async function () {
await init();
2020-11-04 17:40:36 +00:00
expect(getContext().getCurveOrder()).to.be.equal(
"52435875175126190479447740508185965837690552500527637822603658699938581184513"
);
});
it("throws if context not initialized", async function () {
expect(() => getContext().getCurveOrder()).to.throw();
});
2020-11-04 17:40:36 +00:00
});