Remove async from runForAllImplementations

This commit is contained in:
dapplion 2020-11-29 22:23:48 +00:00
parent 46b317b528
commit d3616e50f6
5 changed files with 6 additions and 5 deletions

2
.gitignore vendored
View File

@ -65,3 +65,5 @@ typings/
dist/ dist/
lib/ lib/
benchmark-reports benchmark-reports
.vscode/

View File

@ -3,9 +3,7 @@ import {runForAllImplementations} from "../switch";
import {IPublicKey, ISignature} from "../../src/interface"; import {IPublicKey, ISignature} from "../../src/interface";
import {randomBytes} from "../../src/helpers"; import {randomBytes} from "../../src/helpers";
runForAllImplementations(async (bls, implementation) => { runForAllImplementations((bls, implementation) => {
await bls.init();
const aggCount = 30; const aggCount = 30;
// verify // verify

View File

@ -15,11 +15,12 @@ export function getBls(implementation: Implementation): IBls {
} }
export async function runForAllImplementations( export async function runForAllImplementations(
callback: (bls: IBls, implementation: Implementation) => Promise<void> | void callback: (bls: IBls, implementation: Implementation) => void
): Promise<void> { ): Promise<void> {
for (const implementation of ["blst", "herumi"] as Implementation[]) { for (const implementation of ["blst", "herumi"] as Implementation[]) {
const bls = getBls(implementation); const bls = getBls(implementation);
await callback(bls, implementation); await bls.init();
callback(bls, implementation);
} }
} }