Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/bls/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chainsafe/bls",
"version": "0.1.7",
Comment thread
mpetrunic marked this conversation as resolved.
"version": "0.2.0",
"description": "Implementation of bls signature verification for ethereum 2.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -23,11 +23,11 @@
"build": "yarn build-lib && yarn build-types",
"build:release": "yarn clean && yarn build && yarn build-web",
"build-lib": "babel src -x .ts -d lib",
"build-types": "tsc --declaration --incremental --outDir lib --emitDeclarationOnly",
"build-types": "tsc --declaration --project tsconfig.build.json --incremental --outDir lib --emitDeclarationOnly",
"build-web": "webpack --mode production --entry ./lib/web.js --output ./dist/bls.min.js",
"check-types": "tsc --noEmit",
"lint": "eslint --ext .ts src/",
"lint:fix": "eslint --ext .ts src/ --fix",
"lint": "eslint --color --ext .ts src/",
"lint:fix": "yarn run lint --fix",
"pretest": "yarn check-types",
"prepublishOnly": "yarn build",
"test:unit": "nyc --cache-dir .nyc_output/.cache -r lcov -e .ts mocha --colors -r ts-node/register 'test/unit/**/*.test.ts' && nyc report",
Expand All @@ -38,11 +38,10 @@
"benchmark": "node -r ./.babel-register test/benchmarks"
},
"dependencies": {
"@chainsafe/eth2-bls-wasm": "^0.1.0",
"@chainsafe/eth2.0-types": "^0.1.0",
"@chainsafe/milagro-crypto-js": "0.1.3",
"assert": "^1.4.1",
"js-sha256": "^0.9.0",
"secure-random": "^1.1.1"
"bls-wasm": "^0.2.7"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
Expand All @@ -67,6 +66,7 @@
"codecov": "^3.1.0",
"eslint": "^5.14.1",
"js-yaml": "^3.13.1",
"js-sha256": "^0.9.0",
"mocha": "^6.2.0",
"nyc": "^13.3.0",
"sinon": "^7.2.7",
Expand Down
3 changes: 0 additions & 3 deletions packages/bls/src/@types/secure-random/index.d.ts

This file was deleted.

21 changes: 21 additions & 0 deletions packages/bls/src/context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import blsWasmWrapper from "@chainsafe/eth2-bls-wasm";

let blsWrapper: typeof blsWasmWrapper | null = null;

export async function init(): Promise<typeof blsWasmWrapper> {
if(blsWrapper) return blsWrapper;
await blsWasmWrapper.init();
blsWrapper = blsWasmWrapper;
return blsWrapper;
}

export function destroy(): void {
blsWrapper = null;
}

export function getContext(): typeof blsWasmWrapper{
if(blsWrapper) {
return blsWrapper;
}
throw new Error("BLS not initialized");
}
3 changes: 0 additions & 3 deletions packages/bls/src/ctx.ts

This file was deleted.

14 changes: 0 additions & 14 deletions packages/bls/src/helpers/ec-pairing.ts

This file was deleted.

134 changes: 0 additions & 134 deletions packages/bls/src/helpers/g1point.ts

This file was deleted.

Loading