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.
2020-11-04 17:40:36 +00:00
|
|
|
import { init, getContext, destroy } from "../../src/context";
|
|
|
|
import { expect } from "chai";
|
2019-11-27 18:21:37 +00:00
|
|
|
|
|
|
|
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"
|
|
|
|
);
|
2019-11-27 18:21:37 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("throws if context not initialized", async function () {
|
|
|
|
expect(() => getContext().getCurveOrder()).to.throw();
|
|
|
|
});
|
2020-11-04 17:40:36 +00:00
|
|
|
});
|