Skip to content

Commit

Permalink
chore: update imports to match new folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Apr 4, 2024
1 parent 97e5aae commit 7b5fbc0
Show file tree
Hide file tree
Showing 26 changed files with 30 additions and 28 deletions.
8 changes: 4 additions & 4 deletions scripts/dev.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import {resolve} from "path";
import {watchWithCallback} from "./watch";
import {cmdStringExec} from "../rebuild/tools/exec";
import {exec} from "../utils";

const DEBOUNCE_TIME = 500;
const testCommand = "npm run test:unit";
Expand All @@ -20,16 +20,16 @@ void watchWithCallback({
path: SRC_FOLDER,
debounceTime: DEBOUNCE_TIME,
cb: () =>
cmdStringExec(buildCommand, false)
exec(buildCommand, false)
.then(console.log)
// timeout set if undefined behavior creeps in. keeps from hung tests
.then(() => cmdStringExec(testCommand, false, {timeout: 20 * 1000}))
.then(() => exec(testCommand, false, {timeout: 20 * 1000}))
.then(console.log)
.catch(console.error),
});

void watchWithCallback({
path: TESTS_FOLDER,
debounceTime: DEBOUNCE_TIME,
cb: () => cmdStringExec(testCommand, false).then(console.log).catch(console.error),
cb: () => exec(testCommand, false).then(console.log).catch(console.error),
});
2 changes: 1 addition & 1 deletion test/fuzz/testCases.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {verify, SecretKey, PublicKey, Signature} from "../../rebuild/lib";
import {verify, SecretKey, PublicKey, Signature} from "../../lib";

export interface FuzzTestCase {
name: string;
Expand Down
2 changes: 1 addition & 1 deletion test/memory/memory.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {memoryTest} from "../utils/memory/testRunner";
import * as napi from "../../rebuild/lib";
import * as napi from "../../lib";

const sk = napi.SecretKey.fromKeygen(Buffer.alloc(32, "*&@#"));
const skBytes = sk.serialize();
Expand Down
2 changes: 1 addition & 1 deletion test/perf/PublicKey.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {itBench} from "@dapplion/benchmark";
import * as blst from "../../rebuild/lib";
import * as blst from "../../lib";
import {arrayOfIndexes, getTestSet, getSerializedTestSet} from "../utils";

const napiTestKey = getTestSet(0).publicKey;
Expand Down
2 changes: 1 addition & 1 deletion test/perf/SecretKey.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {itBench} from "@dapplion/benchmark";
import * as blst from "../../rebuild/lib";
import * as blst from "../../lib";
import {keygenMaterial, commonMessage, getTestSet} from "../utils";

const napiTestKey = getTestSet(0).secretKey;
Expand Down
2 changes: 1 addition & 1 deletion test/perf/Signature.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {itBench} from "@dapplion/benchmark";
import * as blst from "../../rebuild/lib";
import * as blst from "../../lib";
import {arrayOfIndexes, getTestSet, getSerializedTestSet} from "../utils";

const napiTestSignature = getTestSet(0).signature;
Expand Down
2 changes: 1 addition & 1 deletion test/perf/functions.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {itBench} from "@dapplion/benchmark";
import * as blst from "../../rebuild/lib";
import * as blst from "../../lib";
import {arrayOfIndexes, getTestSet, getTestSetSameMessage} from "../utils";

describe("functions", () => {
Expand Down
1 change: 1 addition & 0 deletions test/perf/multithreading.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ for (const addVerificationRandomness of [true, false]) {
});

after(async () => {
// eslint-disable-next-line no-console
console.log({
blsPoolSize: blsPool.blsPoolSize,
});
Expand Down
2 changes: 1 addition & 1 deletion test/spec/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
verify as VERIFY,
aggregateVerify,
fastAggregateVerify,
} from "../../rebuild/lib";
} from "../../lib";
import {fromHex, toHex} from "../utils";

// Example full path
Expand Down
2 changes: 1 addition & 1 deletion test/unit/PublicKey.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from "chai";
import {BLST_CONSTANTS, CoordType, PublicKey, SecretKey} from "../../rebuild/lib";
import {BLST_CONSTANTS, CoordType, PublicKey, SecretKey} from "../../lib";
import {expectEqualHex, expectNotEqualHex, sullyUint8Array} from "../utils";
import {validPublicKey, SECRET_KEY_BYTES, invalidInputs, badPublicKey, G1_POINT_AT_INFINITY} from "../__fixtures__";

Expand Down
2 changes: 1 addition & 1 deletion test/unit/SecretKey.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from "chai";
import {PublicKey, SecretKey, Signature, BLST_CONSTANTS} from "../../rebuild/lib";
import {PublicKey, SecretKey, Signature, BLST_CONSTANTS} from "../../lib";
import {KEY_MATERIAL, SECRET_KEY_BYTES, invalidInputs} from "../__fixtures__";
import {expectEqualHex, expectNotEqualHex} from "../utils";

Expand Down
2 changes: 1 addition & 1 deletion test/unit/Signature.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from "chai";
import {BLST_CONSTANTS, CoordType, SecretKey, Signature} from "../../rebuild/lib";
import {BLST_CONSTANTS, CoordType, SecretKey, Signature} from "../../lib";
import {expectEqualHex, expectNotEqualHex, sullyUint8Array} from "../utils";
import {G2_POINT_AT_INFINITY, KEY_MATERIAL, invalidInputs, validSignature} from "../__fixtures__";

Expand Down
2 changes: 1 addition & 1 deletion test/unit/aggregatePublicKeys.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from "chai";
import {aggregatePublicKeys, PublicKey} from "../../rebuild/lib";
import {aggregatePublicKeys, PublicKey} from "../../lib";
import {isEqualBytes, getTestSets} from "../utils";
import {badPublicKey} from "../__fixtures__";

Expand Down
2 changes: 1 addition & 1 deletion test/unit/aggregateSignatures.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from "chai";
import {aggregateSignatures, Signature} from "../../rebuild/lib";
import {aggregateSignatures, Signature} from "../../lib";
import {isEqualBytes, getTestSets} from "../utils";
import {badSignature} from "../__fixtures__";

Expand Down
2 changes: 1 addition & 1 deletion test/unit/bindings.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from "chai";
import * as bindings from "../../rebuild/lib";
import * as bindings from "../../lib";

describe("bindings", () => {
describe("exports", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from "chai";
import {aggregateSignatures, fastAggregateVerify, verify, verifyMultipleAggregateSignatures} from "../../rebuild/lib";
import {aggregateSignatures, fastAggregateVerify, verify, verifyMultipleAggregateSignatures} from "../../lib";
import {
BlsMultiThreading,
arrayOfIndexes,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/verify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
asyncVerify,
fastAggregateVerify,
verify,
} from "../../rebuild/lib";
} from "../../lib";
import {sullyUint8Array, getTestSet} from "../utils";
import {TestSet} from "../utils/types";

Expand Down
2 changes: 1 addition & 1 deletion test/unit/verifyMultipleAggregateSignatures.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from "chai";
import {asyncVerifyMultipleAggregateSignatures, verifyMultipleAggregateSignatures} from "../../rebuild/lib";
import {asyncVerifyMultipleAggregateSignatures, verifyMultipleAggregateSignatures} from "../../lib";
import {getTestSets} from "../utils";

describe("Verify Multiple Aggregate Signatures", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/utils/multithreading/blsMultiThreading.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PublicKey} from "../../../rebuild/lib";
import {PublicKey} from "../../../lib";
import {chunkifyMaximizeChunkSize} from "../../utils";
import {
BlsMultiThreadWorkerPoolOptions,
Expand Down
2 changes: 1 addition & 1 deletion test/utils/multithreading/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import crypto from "crypto";
import {aggregateSignatures} from "../../../rebuild/lib";
import {aggregateSignatures} from "../../../lib";
import {getTestSet, getTestSetSameMessage} from "../testSets";
import {shuffle} from "../helpers";
import {
Expand Down
2 changes: 1 addition & 1 deletion test/utils/multithreading/queuedJob.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CoordType, PublicKey, Signature, aggregatePublicKeys, aggregateSignatures} from "../../../rebuild/lib";
import {CoordType, PublicKey, Signature, aggregatePublicKeys, aggregateSignatures} from "../../../lib";
import {BlsWorkRequest, ISignatureSet, SignatureSetType, VerifySignatureOpts} from "./types";
import {LinkedList} from "./array";
import {getAggregatePublicKey} from "./verify";
Expand Down
2 changes: 1 addition & 1 deletion test/utils/multithreading/runWorkRequests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {SignatureSet} from "../../../rebuild/lib";
import {SignatureSet} from "../../../lib";
import {chunkifyMaximizeChunkSize} from "../../utils";
import {WorkResult, WorkResultCode, BlsWorkResult, BlsWorkRequest} from "./types";
import {asyncVerifyNapiSignatureSets} from "./verify";
Expand Down
2 changes: 1 addition & 1 deletion test/utils/multithreading/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PublicKey, Signature} from "../../../rebuild/lib";
import {PublicKey, Signature} from "../../../lib";
import {SignatureSetArray} from "../types";

export enum SignatureSetType {
Expand Down
2 changes: 1 addition & 1 deletion test/utils/multithreading/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
asyncVerifyMultipleAggregateSignatures,
verify,
verifyMultipleAggregateSignatures,
} from "../../../rebuild/lib";
} from "../../../lib";
import {ISignatureSet, SignatureSetType} from "./types";

const MIN_SET_COUNT_TO_BATCH = 2;
Expand Down
3 changes: 2 additions & 1 deletion test/utils/testSets.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {SecretKey, Signature, BLST_CONSTANTS} from "../../rebuild/lib";
import crypto from "crypto";
import {SecretKey, Signature, BLST_CONSTANTS} from "../../lib";
import {TestSet, SerializedSet} from "./types";
import {arrayOfIndexes} from "./helpers";

Expand Down
2 changes: 1 addition & 1 deletion test/utils/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as bindings from "../../rebuild/lib";
import * as bindings from "../../lib";

export type BufferLike = string | Uint8Array | Buffer | bindings.Serializable;

Expand Down

0 comments on commit 7b5fbc0

Please sign in to comment.