From d3616e50f6c7c386ac2b7702c7ba6eeecc1da4e6 Mon Sep 17 00:00:00 2001 From: dapplion Date: Sun, 29 Nov 2020 22:23:48 +0000 Subject: [PATCH] Remove async from runForAllImplementations --- .gitignore | 2 ++ test/benchmark/index.ts | 4 +--- test/spec/{aggregate_sigs.test.ts => aggregate.test.ts} | 0 ...ggregate_sigs_verify.test.ts => aggregate_verify.test.ts} | 0 test/switch.ts | 5 +++-- 5 files changed, 6 insertions(+), 5 deletions(-) rename test/spec/{aggregate_sigs.test.ts => aggregate.test.ts} (100%) rename test/spec/{aggregate_sigs_verify.test.ts => aggregate_verify.test.ts} (100%) diff --git a/.gitignore b/.gitignore index 6da32d7..0e4aaad 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,5 @@ typings/ dist/ lib/ benchmark-reports + +.vscode/ diff --git a/test/benchmark/index.ts b/test/benchmark/index.ts index 9136baa..9e0380f 100644 --- a/test/benchmark/index.ts +++ b/test/benchmark/index.ts @@ -3,9 +3,7 @@ import {runForAllImplementations} from "../switch"; import {IPublicKey, ISignature} from "../../src/interface"; import {randomBytes} from "../../src/helpers"; -runForAllImplementations(async (bls, implementation) => { - await bls.init(); - +runForAllImplementations((bls, implementation) => { const aggCount = 30; // verify diff --git a/test/spec/aggregate_sigs.test.ts b/test/spec/aggregate.test.ts similarity index 100% rename from test/spec/aggregate_sigs.test.ts rename to test/spec/aggregate.test.ts diff --git a/test/spec/aggregate_sigs_verify.test.ts b/test/spec/aggregate_verify.test.ts similarity index 100% rename from test/spec/aggregate_sigs_verify.test.ts rename to test/spec/aggregate_verify.test.ts diff --git a/test/switch.ts b/test/switch.ts index 942f6ae..c86f143 100644 --- a/test/switch.ts +++ b/test/switch.ts @@ -15,11 +15,12 @@ export function getBls(implementation: Implementation): IBls { } export async function runForAllImplementations( - callback: (bls: IBls, implementation: Implementation) => Promise | void + callback: (bls: IBls, implementation: Implementation) => void ): Promise { for (const implementation of ["blst", "herumi"] as Implementation[]) { const bls = getBls(implementation); - await callback(bls, implementation); + await bls.init(); + callback(bls, implementation); } }