address Pr comments
This commit is contained in:
parent
8c10a06d79
commit
72f95898a8
|
@ -3,15 +3,11 @@ import {PrivateKey} from "./privateKey";
|
|||
import {PublicKey} from "./publicKey";
|
||||
import {Signature} from "./signature";
|
||||
import {BLSPubkey, BLSSecretKey, BLSSignature, Domain, Hash} from "@chainsafe/eth2.0-types";
|
||||
import {init} from "./context";
|
||||
import {PUBLIC_KEY_LENGTH} from "./constants";
|
||||
|
||||
export {Keypair, PrivateKey, PublicKey, Signature};
|
||||
|
||||
|
||||
export async function initLibrary(): Promise<void> {
|
||||
await init();
|
||||
}
|
||||
export {init as initBLS} from "./context";
|
||||
|
||||
/**
|
||||
* Generates new secret and public key
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Import benchmarks
|
||||
import * as suites from "./suites";
|
||||
import {createReportDir, runSuite} from "@chainsafe/benchmark-utils";
|
||||
import {initLibrary} from "../../src";
|
||||
import {initBLS} from "../../src";
|
||||
// Create file
|
||||
const directory: string = createReportDir();
|
||||
|
||||
initLibrary().then(() => {
|
||||
initBLS().then(() => {
|
||||
// Run benchmarks
|
||||
Object.values(suites).forEach((suite) => {
|
||||
runSuite(suite(directory));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bls, {initLibrary} from "../../src";
|
||||
import bls, {initBLS} from "../../src";
|
||||
import {describeDirectorySpecTest, InputType} from "@chainsafe/eth2.0-spec-test-util/lib/single";
|
||||
import path from "path";
|
||||
|
||||
|
@ -10,7 +10,7 @@ interface IAggregatePubKeysTestCase {
|
|||
}
|
||||
|
||||
before(async function f() {
|
||||
await initLibrary();
|
||||
await initBLS();
|
||||
});
|
||||
|
||||
describeDirectorySpecTest<IAggregatePubKeysTestCase, string>(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import path from "path";
|
||||
import bls, {initLibrary} from "../../src";
|
||||
import bls, {initBLS} from "../../src";
|
||||
import {describeDirectorySpecTest, InputType} from "@chainsafe/eth2.0-spec-test-util/lib/single";
|
||||
|
||||
interface AggregateSigsTestCase {
|
||||
|
@ -10,7 +10,7 @@ interface AggregateSigsTestCase {
|
|||
}
|
||||
|
||||
before(async function f() {
|
||||
await initLibrary();
|
||||
await initBLS();
|
||||
});
|
||||
|
||||
describeDirectorySpecTest<AggregateSigsTestCase, string>(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bls, {initLibrary} from "../../src";
|
||||
import bls, {initBLS} from "../../src";
|
||||
import {describeDirectorySpecTest, InputType} from "@chainsafe/eth2.0-spec-test-util/lib/single";
|
||||
import path from "path";
|
||||
|
||||
|
@ -10,7 +10,7 @@ interface IPrivToPubTestCase {
|
|||
}
|
||||
|
||||
before(async function f() {
|
||||
await initLibrary();
|
||||
await initBLS();
|
||||
});
|
||||
|
||||
describeDirectorySpecTest<IPrivToPubTestCase, string>(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import path from "path";
|
||||
import bls, {initLibrary} from "../../src";
|
||||
import bls, {initBLS} from "../../src";
|
||||
import {padLeft} from "../../src/helpers/utils";
|
||||
import {describeDirectorySpecTest, InputType} from "@chainsafe/eth2.0-spec-test-util/lib/single";
|
||||
|
||||
|
@ -15,7 +15,7 @@ interface ISignMessageTestCase {
|
|||
}
|
||||
|
||||
before(async function f() {
|
||||
await initLibrary();
|
||||
await initBLS();
|
||||
});
|
||||
|
||||
describeDirectorySpecTest<ISignMessageTestCase, string>(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import bls, {aggregatePubkeys, aggregateSignatures, initLibrary, Keypair, verify, verifyMultiple} from "../../src";
|
||||
import bls, {aggregatePubkeys, aggregateSignatures, initBLS, Keypair, verify, verifyMultiple} from "../../src";
|
||||
import {sha256} from "js-sha256";
|
||||
import {expect} from "chai";
|
||||
import {destroy} from "../../src/context";
|
||||
|
@ -7,7 +7,7 @@ import {padLeft} from "../../lib/helpers/utils";
|
|||
describe("test bls", function () {
|
||||
|
||||
before(async function() {
|
||||
await initLibrary();
|
||||
await initBLS();
|
||||
});
|
||||
|
||||
after(function () {
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import {PrivateKey} from "../../src/privateKey";
|
||||
import {PublicKey} from "../../src/publicKey";
|
||||
import {Keypair} from "../../src/keypair";
|
||||
import {PrivateKey,PublicKey,Keypair} from "../../src";
|
||||
import {expect} from "chai";
|
||||
import {destroy, init} from "../../src/context";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {PrivateKey} from "../../src/privateKey";
|
||||
import {PrivateKey} from "../../src";
|
||||
import {expect} from "chai";
|
||||
import {SECRET_KEY_LENGTH} from "../../src/constants";
|
||||
import {destroy, init} from "../../src/context";
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import {destroy, init} from "../../src/context";
|
||||
import {PublicKey} from "../../src/publicKey";
|
||||
import {PublicKey, PrivateKey} from "../../src";
|
||||
import {expect} from "chai";
|
||||
import { PrivateKey } from "../../src/privateKey";
|
||||
|
||||
|
||||
describe("public key", function () {
|
||||
|
||||
|
|
Reference in New Issue