From a5c7267d7bccc8904b5c3becfb103739160bcf99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Petruni=C4=87?= Date: Thu, 30 Jan 2020 13:49:56 +0100 Subject: [PATCH 1/5] update bls wasm version --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 08de1fc..c923038 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,7 @@ "@chainsafe/bls-keygen": "^0.0.2", "@chainsafe/eth2-bls-wasm": "^0.2.0", "@chainsafe/eth2.0-types": "^0.2.0", - "assert": "^1.4.1", - "bls-wasm": "^0.2.7" + "assert": "^1.4.1" }, "devDependencies": { "@chainsafe/benchmark-utils": "^0.1.0", From a1b61472772dbfebbacbce15027c910bff42c469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Petruni=C4=87?= Date: Fri, 31 Jan 2020 11:17:26 +0100 Subject: [PATCH 2/5] add bls browser test execution --- karma.conf.js | 26 ++++++++++++++++++++++++++ package.json | 12 +++++++++++- webpack.config.js | 20 ++++++++++++++++---- 3 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 karma.conf.js diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 0000000..c1e73de --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,26 @@ +// eslint-disable-next-line @typescript-eslint/no-require-imports +const webpackConfig = require("./webpack.config"); + +module.exports = function(config) { + config.set({ + + basePath: "", + frameworks: ["mocha", "chai"], + files: ["test/unit/*.ts"], + exclude: [], + preprocessors: { + "test/**/*.ts": ["webpack"] + }, + webpack: { + mode: "production", + node: webpackConfig.node, + module: webpackConfig.module, + resolve: webpackConfig.resolve + }, + reporters: ["spec"], + + browsers: ["ChromeHeadless"], + + singleRun: true + }); +}; \ No newline at end of file diff --git a/package.json b/package.json index c923038..0cafb2d 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,9 @@ "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", + "test:web:unit": "karma start", + "test:node:unit": "nyc --cache-dir .nyc_output/.cache -r lcov -e .ts mocha --colors -r ts-node/register 'test/unit/**/*.test.ts' && nyc report", + "test:unit": "yarn run test:node:unit && yarn run test:web:unit", "test": "yarn test:unit", "coverage": "codecov -F bls", "benchmark": "node -r ./.babel-register test/benchmarks" @@ -45,6 +47,14 @@ "@chainsafe/benchmark-utils": "^0.1.0", "js-sha256": "^0.9.0", "js-yaml": "^3.13.1", + "karma": "^4.4.1", + "karma-chai": "^0.1.0", + "karma-chrome-launcher": "^3.1.0", + "karma-cli": "^2.0.0", + "karma-mocha": "^1.3.0", + "karma-spec-reporter": "^0.0.32", + "karma-webpack": "^4.0.2", + "ts-loader": "^6.2.1", "webpack": "^4.30.0", "webpack-cli": "^3.3.2" } diff --git a/webpack.config.js b/webpack.config.js index 28f9f3c..3953a1f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,18 @@ module.exports = { - mode: "production", - node: { - fs: "empty" - } + entry: "./src/index.ts", + mode: "production", + node: { + fs: "empty" + }, + output: { + filename: "dist/bundle.js" + }, + resolve: { + extensions: [".ts", ".js"] + }, + module: { + rules: [ + {test: /\.ts$/, use: {loader: "ts-loader", options: {transpileOnly: true}}} + ] + } }; \ No newline at end of file From bb59c26ea652800e820c741c0efbe125b57c75de Mon Sep 17 00:00:00 2001 From: Cayman Date: Tue, 4 Feb 2020 10:30:14 -0600 Subject: [PATCH 3/5] bls v0.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0cafb2d..8458e56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@chainsafe/bls", - "version": "0.2.0", + "version": "0.2.1", "description": "Implementation of bls signature verification for ethereum 2.0", "main": "lib/index.js", "types": "lib/index.d.ts", From ea33add576c85d93671a5cd3bd7528f912ea87e0 Mon Sep 17 00:00:00 2001 From: Cayman Date: Tue, 4 Feb 2020 15:01:35 -0600 Subject: [PATCH 4/5] Remove old spec references, update tags to 0.9.3 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b46228f..2e23bec 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/ChainSafe/lodestar.svg?branch=master)](https://travis-ci.org/ChainSafe/lodestar) [![codecov](https://codecov.io/gh/ChainSafe/lodestar/branch/master/graph/badge.svg)](https://codecov.io/gh/ChainSafe/lodestar) -![ETH2.0_Spec_Version 0.9.2](https://img.shields.io/badge/ETH2.0_Spec_Version-0.8.2-2e86c1.svg) +![ETH2.0_Spec_Version 0.9.3](https://img.shields.io/badge/ETH2.0_Spec_Version-0.9.3-2e86c1.svg) This is a Javascript library that implements BLS (Boneh-Lynn-Shacham) signatures and supports signature aggregation. From bb944a314a2cdedc5bda373fdf1a4c3754086955 Mon Sep 17 00:00:00 2001 From: Cayman Date: Wed, 5 Feb 2020 09:45:15 -0600 Subject: [PATCH 5/5] Bump all spec version tags to v0.9.4 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e23bec..254e8dc 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/ChainSafe/lodestar.svg?branch=master)](https://travis-ci.org/ChainSafe/lodestar) [![codecov](https://codecov.io/gh/ChainSafe/lodestar/branch/master/graph/badge.svg)](https://codecov.io/gh/ChainSafe/lodestar) -![ETH2.0_Spec_Version 0.9.3](https://img.shields.io/badge/ETH2.0_Spec_Version-0.9.3-2e86c1.svg) +![ETH2.0_Spec_Version 0.9.4](https://img.shields.io/badge/ETH2.0_Spec_Version-0.9.4-2e86c1.svg) This is a Javascript library that implements BLS (Boneh-Lynn-Shacham) signatures and supports signature aggregation.