Skip to content

Commit

Permalink
chore: support node 18 and 20
Browse files Browse the repository at this point in the history
  • Loading branch information
jeluard committed Apr 2, 2024
1 parent f30cd5c commit d9748f2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Setup Nodejs
uses: actions/setup-node@v1
with:
node-version: "14.x"
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: yarn install --non-interactive --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [14, 16]
node: [18, 20]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand Down
4 changes: 2 additions & 2 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"exports": "./index.js",
"license": "MIT",
"scripts": {
"benchmark": "ts-node-esm index",
"benchmark:all": "ts-node-esm index && ts-node-esm noble && ts-node-esm verifyMultipleSignaturesSavings"
"benchmark": "node --loader ts-node/esm index",
"benchmark:all": "node --loader ts-node/esm index.ts && node --loader ts-node/esm noble.ts && node --loader ts-node/esm verifyMultipleSignaturesSavings.ts"
},
"dependencies": {
"noble-bls12-381": "^0.7.2"
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "7.1.3",
"description": "Implementation of bls signature verification for ethereum 2.0",
"engines": {
"node": ">=14.8.0"
"node": ">=18"
},
"type": "module",
"exports": {
Expand Down Expand Up @@ -72,9 +72,9 @@
"test:coverage": "nyc --cache-dir .nyc_output/.cache -r lcov -e .ts mocha 'test/unit/**/*.test.ts' && nyc report",
"test:spec": "mocha 'test/spec/**/*.test.ts'",
"test": "yarn run test:unit && yarn run test:spec",
"download-test-cases": "ts-node-esm test/downloadSpecTests.ts",
"download-test-cases": "node --loader ts-node/esm test/downloadSpecTests.ts",
"coverage": "codecov -F bls",
"benchmark": "ts-node-esm benchmark",
"benchmark": "node --loader ts-node/esm benchmark/index.ts",
"benchmark:all": "cd benchmark && yarn install && yarn benchmark:all"
},
"dependencies": {
Expand Down
21 changes: 4 additions & 17 deletions test/switch.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
import blst from "../src/blst-native/index.js";
import herumi from "../src/herumi/index.js";
import {IBls} from "../src/types.js";

export type Implementation = "blst" | "herumi";

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export function getBls(implementation: Implementation): IBls {
switch (implementation) {
case "blst":
return blst;
case "herumi":
return herumi;
}
}
import {getImplementation} from "../src/getImplementation.js";
import {IBls, Implementation} from "../src/types.js";

export async function runForAllImplementations(
callback: (bls: IBls, implementation: Implementation) => void
): Promise<void> {
for (const implementation of ["blst", "herumi"] as Implementation[]) {
const bls = getBls(implementation);
for (const implementation of ["blst-native", "herumi"] as Implementation[]) {
const bls = await getImplementation(implementation);
callback(bls, implementation);
}
}
Expand Down

0 comments on commit d9748f2

Please sign in to comment.