From ef491d276065ee38aef4397b425556271f108fe7 Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Thu, 19 Dec 2024 18:02:30 +0100 Subject: [PATCH] Fix import paths for types --- packages/as-sha256/test/perf/index.test.ts | 2 +- packages/as-sha256/test/perf/simd.test.ts | 2 +- packages/as-sha256/test/unit/index.test.ts | 2 +- packages/as-sha256/test/unit/simd.test.ts | 2 +- .../test/perf/gindex.test.ts | 2 +- .../test/perf/hashComputation.test.ts | 2 +- .../test/perf/hasher.test.ts | 2 +- .../test/perf/node.test.ts | 2 +- .../test/perf/tree.test.ts | 2 +- .../test/perf/tree/depthSmall.test.ts | 2 +- .../test/perf/tree/getNodes.test.ts | 2 +- .../test/perf/tree/setNodes.test.ts | 2 +- .../test/perf/treeDepth.test.ts | 2 +- .../test/perf/validators.test.ts | 2 +- .../test/unit/backing.test.ts | 2 +- .../test/unit/gindex.test.ts | 2 +- .../test/unit/hashComputation.test.ts | 2 +- .../test/unit/hasher.test.ts | 2 +- .../test/unit/node.test.ts | 2 +- .../test/unit/packedNode.test.ts | 2 +- .../test/unit/snapshot.test.ts | 2 +- .../test/unit/subtree.test.ts | 2 +- .../test/unit/tree.test.ts | 2 +- .../test/unit/tree/getNodes.test.ts | 2 +- .../test/unit/tree/zeroAfterIndex.test.ts | 2 +- .../persistent-merkle-tree/test/utils/tree.ts | 2 +- packages/persistent-ts/package.json | 2 +- .../src/components/Input.tsx | 4 ++-- .../src/components/Serialize.tsx | 2 +- .../src/components/TreeView.tsx | 2 +- .../src/components/worker/helpers.ts | 2 +- .../simpleserialize.com/src/util/types.ts | 11 +--------- .../ssz/test/lodestarTypes/allForks/index.ts | 6 ++--- .../test/lodestarTypes/allForks/sszTypes.ts | 10 ++++----- .../ssz/test/lodestarTypes/allForks/types.ts | 22 +++++++++---------- .../ssz/test/lodestarTypes/altair/index.ts | 6 ++--- .../ssz/test/lodestarTypes/altair/sszTypes.ts | 8 +++---- .../ssz/test/lodestarTypes/altair/types.ts | 4 ++-- .../ssz/test/lodestarTypes/bellatrix/index.ts | 6 ++--- .../test/lodestarTypes/bellatrix/sszTypes.ts | 12 +++++----- .../ssz/test/lodestarTypes/bellatrix/types.ts | 4 ++-- .../ssz/test/lodestarTypes/capella/index.ts | 6 ++--- .../test/lodestarTypes/capella/sszTypes.ts | 12 +++++----- .../ssz/test/lodestarTypes/capella/types.ts | 4 ++-- .../ssz/test/lodestarTypes/deneb/index.ts | 6 ++--- .../ssz/test/lodestarTypes/deneb/sszTypes.ts | 14 ++++++------ .../ssz/test/lodestarTypes/deneb/types.ts | 4 ++-- packages/ssz/test/lodestarTypes/index.ts | 8 +++---- .../ssz/test/lodestarTypes/phase0/index.ts | 6 ++--- .../ssz/test/lodestarTypes/phase0/sszTypes.ts | 10 ++++----- .../ssz/test/lodestarTypes/phase0/types.ts | 4 ++-- .../ssz/test/lodestarTypes/primitive/index.ts | 4 ++-- .../test/lodestarTypes/primitive/sszTypes.ts | 2 +- .../ssz/test/lodestarTypes/primitive/types.ts | 4 ++-- packages/ssz/test/lodestarTypes/sszTypes.ts | 14 ++++++------ packages/ssz/test/lodestarTypes/types.ts | 16 +++++++------- .../test/lodestarTypes/utils/StringType.ts | 2 +- .../test/lodestarTypes/utils/typeguards.ts | 6 ++--- packages/ssz/test/memory/bytes.test.ts | 2 +- packages/ssz/test/memory/eth2Objects.test.ts | 6 ++--- packages/ssz/test/memory/hooks.test.ts | 2 +- packages/ssz/test/memory/treeView.test.ts | 2 +- packages/ssz/test/perf/bitlist.test.ts | 2 +- .../ssz/test/perf/byType/listBasic.test.ts | 2 +- .../test/perf/byType/listComposite.test.ts | 2 +- packages/ssz/test/perf/bytelist.test.ts | 2 +- .../test/perf/cacheMutableRootStruct.test.ts | 2 +- packages/ssz/test/perf/epochStatuses.test.ts | 6 ++--- .../ssz/test/perf/eth2/beaconState.test.ts | 6 ++--- .../ssz/test/perf/eth2/deserialize.test.ts | 10 ++++----- .../ssz/test/perf/eth2/hashTreeRoot.test.ts | 10 ++++----- .../ssz/test/perf/eth2/validators.test.ts | 6 ++--- packages/ssz/test/perf/iterate.test.ts | 4 ++-- packages/ssz/test/perf/list.test.ts | 2 +- packages/ssz/test/perf/merkleize.test.ts | 2 +- packages/ssz/test/perf/propertyGet.test.ts | 2 +- packages/ssz/test/perf/serdes.test.ts | 4 ++-- .../processAttestations.test.ts | 2 +- packages/ssz/test/perf/uint.test.ts | 2 +- packages/ssz/test/perf/uintFromBytes.test.ts | 2 +- packages/ssz/test/spec/downloadTests.ts | 2 +- .../ssz/test/spec/eip-4881/eip4881.test.ts | 8 +++---- packages/ssz/test/spec/generic/index.test.ts | 8 +++---- packages/ssz/test/spec/generic/types.ts | 4 ++-- .../spec/replaceUintTypeWithUintBigintType.ts | 2 +- packages/ssz/test/spec/runValidTest.ts | 12 +++++----- packages/ssz/test/spec/ssz_static.test.ts | 4 ++-- packages/ssz/test/spec/ssz_static.ts | 18 +++++++-------- packages/ssz/test/spec/testRunner.ts | 2 +- .../test/unit/byType/bitArray/tree.test.ts | 4 ++-- .../test/unit/byType/bitList/invalid.test.ts | 4 ++-- .../test/unit/byType/bitList/valid.test.ts | 4 ++-- .../unit/byType/bitVector/invalid.test.ts | 4 ++-- .../test/unit/byType/bitVector/tree.test.ts | 4 ++-- .../test/unit/byType/bitVector/valid.test.ts | 4 ++-- .../test/unit/byType/boolean/invalid.test.ts | 4 ++-- .../ssz/test/unit/byType/boolean/tree.test.ts | 4 ++-- .../test/unit/byType/boolean/valid.test.ts | 4 ++-- .../test/unit/byType/byteList/invalid.test.ts | 4 ++-- .../test/unit/byType/byteList/valid.test.ts | 4 ++-- .../unit/byType/byteVector/invalid.test.ts | 4 ++-- .../test/unit/byType/byteVector/tree.test.ts | 2 +- .../test/unit/byType/byteVector/valid.test.ts | 4 ++-- .../test/unit/byType/composite/tree.test.ts | 6 ++--- .../unit/byType/container/invalid.test.ts | 6 ++--- .../test/unit/byType/container/tree.test.ts | 8 +++---- .../test/unit/byType/container/valid.test.ts | 12 +++++----- .../unit/byType/listBasic/invalid.test.ts | 6 ++--- .../test/unit/byType/listBasic/misc.test.ts | 2 +- .../unit/byType/listBasic/mutation.test.ts | 2 +- .../test/unit/byType/listBasic/tree.test.ts | 6 ++--- .../test/unit/byType/listBasic/valid.test.ts | 4 ++-- .../unit/byType/listComposite/invalid.test.ts | 4 ++-- .../unit/byType/listComposite/tree.test.ts | 10 ++++----- .../unit/byType/listComposite/valid.test.ts | 4 ++-- .../ssz/test/unit/byType/none/invalid.test.ts | 4 ++-- .../ssz/test/unit/byType/none/misc.test.ts | 2 +- .../ssz/test/unit/byType/none/valid.test.ts | 4 ++-- .../test/unit/byType/optional/invalid.test.ts | 4 ++-- .../test/unit/byType/optional/tree.test.ts | 2 +- .../test/unit/byType/optional/valid.test.ts | 4 ++-- .../byType/partialListComposite/tree.test.ts | 4 ++-- .../ssz/test/unit/byType/profile/tree.test.ts | 6 ++--- .../test/unit/byType/profile/valid.test.ts | 4 ++-- .../ssz/test/unit/byType/runTypeProofTest.ts | 10 ++++----- .../test/unit/byType/runTypeTestInvalid.ts | 2 +- .../ssz/test/unit/byType/runTypeTestValid.ts | 10 ++++----- .../unit/byType/runViewTestCompositeSwap.ts | 6 ++--- .../test/unit/byType/runViewTestMutation.ts | 4 ++-- .../unit/byType/stableContainer/tree.test.ts | 6 ++--- .../unit/byType/stableContainer/valid.test.ts | 4 ++-- .../ssz/test/unit/byType/uint/invalid.test.ts | 6 ++--- .../ssz/test/unit/byType/uint/tree.test.ts | 4 ++-- .../ssz/test/unit/byType/uint/valid.test.ts | 4 ++-- .../test/unit/byType/union/invalid.test.ts | 4 ++-- .../ssz/test/unit/byType/union/tree.test.ts | 2 +- .../ssz/test/unit/byType/union/valid.test.ts | 4 ++-- .../test/unit/byType/vector/invalid.test.ts | 6 ++--- .../ssz/test/unit/byType/vector/valid.test.ts | 4 ++-- .../test/unit/byType/vectorBasic/tree.test.ts | 4 ++-- .../unit/byType/vectorComposite/tree.test.ts | 4 ++-- .../ssz/test/unit/byValue/bitArray.test.ts | 6 ++--- .../unit/cachePermanentRootStruct.test.ts | 2 +- packages/ssz/test/unit/eth2/allForks.test.ts | 6 ++--- .../ssz/test/unit/eth2/beaconState.test.ts | 8 +++---- packages/ssz/test/unit/eth2/caseEth2.test.ts | 2 +- .../ssz/test/unit/eth2/minMaxSize.test.ts | 4 ++-- .../ssz/test/unit/eth2/regressions.test.ts | 2 +- .../ssz/test/unit/eth2/validators.test.ts | 4 ++-- packages/ssz/test/unit/merkleize.test.ts | 2 +- packages/ssz/test/unit/named.test.ts | 2 +- packages/ssz/test/unit/packing.test.ts | 2 +- packages/ssz/test/unit/regressions.test.ts | 4 ++-- packages/ssz/test/unit/snapshot.test.ts | 6 ++--- .../ssz/test/unit/specTestYamlLoader.test.ts | 6 ++--- packages/ssz/test/unit/strings.test.ts | 4 ++-- .../ssz/test/unit/unchangedViewDUs.test.ts | 4 ++-- packages/ssz/test/unit/util/errorPath.test.ts | 4 ++-- packages/ssz/test/unit/util/hexString.test.ts | 2 +- packages/ssz/test/unit/util/proof.test.ts | 8 +++---- packages/ssz/test/unit/util/proofs.test.ts | 2 +- packages/ssz/test/utils/generateEth2Objs.ts | 8 +++---- packages/ssz/test/utils/primitiveTypes.ts | 2 +- 163 files changed, 369 insertions(+), 378 deletions(-) diff --git a/packages/as-sha256/test/perf/index.test.ts b/packages/as-sha256/test/perf/index.test.ts index c0ff38bbc..2e420aeac 100644 --- a/packages/as-sha256/test/perf/index.test.ts +++ b/packages/as-sha256/test/perf/index.test.ts @@ -1,5 +1,5 @@ import {itBench, setBenchOpts} from "@dapplion/benchmark"; -import * as sha256 from "../../src"; +import * as sha256 from "../../src/index.js"; // Feb 2024 Mac M1 // digestTwoHashObjects vs digest64 vs digest diff --git a/packages/as-sha256/test/perf/simd.test.ts b/packages/as-sha256/test/perf/simd.test.ts index 615cac339..99c69a01c 100644 --- a/packages/as-sha256/test/perf/simd.test.ts +++ b/packages/as-sha256/test/perf/simd.test.ts @@ -1,5 +1,5 @@ import {itBench, setBenchOpts} from "@dapplion/benchmark"; -import * as sha256 from "../../src"; +import * as sha256 from "../../src/index.js"; import {byteArrayToHashObject} from "../../src/hashObject"; /** diff --git a/packages/as-sha256/test/unit/index.test.ts b/packages/as-sha256/test/unit/index.test.ts index a4bf64b8c..87b666d56 100644 --- a/packages/as-sha256/test/unit/index.test.ts +++ b/packages/as-sha256/test/unit/index.test.ts @@ -1,5 +1,5 @@ import {Buffer} from "buffer"; -import * as sha256 from "../../src"; +import * as sha256 from "../../src/index.js"; import {expect} from "chai"; describe("sha256", function () { diff --git a/packages/as-sha256/test/unit/simd.test.ts b/packages/as-sha256/test/unit/simd.test.ts index a17726b13..d14458d80 100644 --- a/packages/as-sha256/test/unit/simd.test.ts +++ b/packages/as-sha256/test/unit/simd.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; import crypto from "crypto"; import {byteArrayToHashObject, hashObjectToByteArray} from "../../src/hashObject"; -import * as sha256 from "../../src"; +import * as sha256 from "../../src/index.js"; describe("Test SIMD implementation of as-sha256", () => { it("testHash4UintArray64s", () => { diff --git a/packages/persistent-merkle-tree/test/perf/gindex.test.ts b/packages/persistent-merkle-tree/test/perf/gindex.test.ts index c5c69d24b..f4d66101f 100644 --- a/packages/persistent-merkle-tree/test/perf/gindex.test.ts +++ b/packages/persistent-merkle-tree/test/perf/gindex.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {getGindexBits, getGindicesAtDepth, gindexIterator, iterateAtDepth} from "../../src"; +import {getGindexBits, getGindicesAtDepth, gindexIterator, iterateAtDepth} from "../../src/index.js"; describe("gindices at depth", () => { const count = 100; diff --git a/packages/persistent-merkle-tree/test/perf/hashComputation.test.ts b/packages/persistent-merkle-tree/test/perf/hashComputation.test.ts index f93c0e572..dee96bdc3 100644 --- a/packages/persistent-merkle-tree/test/perf/hashComputation.test.ts +++ b/packages/persistent-merkle-tree/test/perf/hashComputation.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import { HashComputation, HashComputationLevel, LeafNode, zeroHash } from "../../src"; +import { HashComputation, HashComputationLevel, LeafNode, zeroHash } from "../../src/index.js"; /** * HashComputationLevel push then loop is faster than HashComputation[] push then loop diff --git a/packages/persistent-merkle-tree/test/perf/hasher.test.ts b/packages/persistent-merkle-tree/test/perf/hasher.test.ts index a01171c2f..a8b4e9b33 100644 --- a/packages/persistent-merkle-tree/test/perf/hasher.test.ts +++ b/packages/persistent-merkle-tree/test/perf/hasher.test.ts @@ -4,7 +4,7 @@ import {hasher as asShaHasher} from "../../src/hasher/as-sha256"; import {hasher as nobleHasher} from "../../src/hasher/noble"; import {hasher as hashtreeHasher} from "../../src/hasher/hashtree"; import {buildComparisonTrees} from "../utils/tree"; -import {HashComputationLevel, getHashComputations} from "../../src"; +import {HashComputationLevel, getHashComputations} from "../../src/index.js"; describe("hasher", function () { this.timeout(0); diff --git a/packages/persistent-merkle-tree/test/perf/node.test.ts b/packages/persistent-merkle-tree/test/perf/node.test.ts index 5de5373b7..941964b04 100644 --- a/packages/persistent-merkle-tree/test/perf/node.test.ts +++ b/packages/persistent-merkle-tree/test/perf/node.test.ts @@ -1,6 +1,6 @@ import {itBench} from "@dapplion/benchmark"; import {BranchNode, getNodeH, LeafNode} from "../../src/node"; -import {countToDepth, getHashComputations, HashComputation, subtreeFillToContents} from "../../src"; +import {countToDepth, getHashComputations, HashComputation, subtreeFillToContents} from "../../src/index.js"; import {batchHash} from "../utils/batchHash"; describe("HashObject LeafNode", () => { diff --git a/packages/persistent-merkle-tree/test/perf/tree.test.ts b/packages/persistent-merkle-tree/test/perf/tree.test.ts index c9df8c9d4..7985ab40c 100644 --- a/packages/persistent-merkle-tree/test/perf/tree.test.ts +++ b/packages/persistent-merkle-tree/test/perf/tree.test.ts @@ -8,7 +8,7 @@ import { toGindex, uint8ArrayToHashObject, toGindexBitstring, -} from "../../src"; +} from "../../src/index.js"; describe("Track the performance of different Tree methods", () => { const VALIDATOR_REGISTRY_LIMIT = 1099511627776; diff --git a/packages/persistent-merkle-tree/test/perf/tree/depthSmall.test.ts b/packages/persistent-merkle-tree/test/perf/tree/depthSmall.test.ts index 7179e89fc..38e6564ad 100644 --- a/packages/persistent-merkle-tree/test/perf/tree/depthSmall.test.ts +++ b/packages/persistent-merkle-tree/test/perf/tree/depthSmall.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {getNodeAtDepth, getNodesAtDepth, setNodeAtDepth, setNodesAtDepth, zeroNode} from "../../../src"; +import {getNodeAtDepth, getNodesAtDepth, setNodeAtDepth, setNodesAtDepth, zeroNode} from "../../../src/index.js"; import {linspace, fillArray} from "../../utils/misc"; describe("Tree opts with low depth", () => { diff --git a/packages/persistent-merkle-tree/test/perf/tree/getNodes.test.ts b/packages/persistent-merkle-tree/test/perf/tree/getNodes.test.ts index 05f3629b9..060e8c4ff 100644 --- a/packages/persistent-merkle-tree/test/perf/tree/getNodes.test.ts +++ b/packages/persistent-merkle-tree/test/perf/tree/getNodes.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {subtreeFillToContents, Tree, Node, LeafNode, getNodesAtDepth, zeroNode, BranchNode} from "../../../src"; +import {subtreeFillToContents, Tree, Node, LeafNode, getNodesAtDepth, zeroNode, BranchNode} from "../../../src/index.js"; // Results in Linux Dec 2021 // diff --git a/packages/persistent-merkle-tree/test/perf/tree/setNodes.test.ts b/packages/persistent-merkle-tree/test/perf/tree/setNodes.test.ts index 69c18b974..e2b6c4419 100644 --- a/packages/persistent-merkle-tree/test/perf/tree/setNodes.test.ts +++ b/packages/persistent-merkle-tree/test/perf/tree/setNodes.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {subtreeFillToContents, Tree, Node, LeafNode, toGindex, setNodesAtDepth} from "../../../src"; +import {subtreeFillToContents, Tree, Node, LeafNode, toGindex, setNodesAtDepth} from "../../../src/index.js"; // Results in Linux Dec 2021 // diff --git a/packages/persistent-merkle-tree/test/perf/treeDepth.test.ts b/packages/persistent-merkle-tree/test/perf/treeDepth.test.ts index 4187eb8f1..6cf7f633f 100644 --- a/packages/persistent-merkle-tree/test/perf/treeDepth.test.ts +++ b/packages/persistent-merkle-tree/test/perf/treeDepth.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {Tree, iterateAtDepth, LeafNode, subtreeFillToDepth} from "../../src"; +import {Tree, iterateAtDepth, LeafNode, subtreeFillToDepth} from "../../src/index.js"; describe("Tree", () => { for (const depth of [8, 16, 32]) { diff --git a/packages/persistent-merkle-tree/test/perf/validators.test.ts b/packages/persistent-merkle-tree/test/perf/validators.test.ts index e27238a3e..182b6250b 100644 --- a/packages/persistent-merkle-tree/test/perf/validators.test.ts +++ b/packages/persistent-merkle-tree/test/perf/validators.test.ts @@ -6,7 +6,7 @@ import { countToDepth, zeroNode, getHashComputations, -} from "../../src"; +} from "../../src/index.js"; import {MemoryTracker} from "../utils/memTracker"; import {batchHash} from "../utils/batchHash"; diff --git a/packages/persistent-merkle-tree/test/unit/backing.test.ts b/packages/persistent-merkle-tree/test/unit/backing.test.ts index 00f461c58..219d46909 100644 --- a/packages/persistent-merkle-tree/test/unit/backing.test.ts +++ b/packages/persistent-merkle-tree/test/unit/backing.test.ts @@ -1,6 +1,6 @@ import {assert} from "chai"; import {describe, it} from "mocha"; -import {Tree, LeafNode, subtreeFillToDepth} from "../../src"; +import {Tree, LeafNode, subtreeFillToDepth} from "../../src/index.js"; describe("get", () => { it("should return the right node", () => { diff --git a/packages/persistent-merkle-tree/test/unit/gindex.test.ts b/packages/persistent-merkle-tree/test/unit/gindex.test.ts index 010d58005..00f6d1cf4 100644 --- a/packages/persistent-merkle-tree/test/unit/gindex.test.ts +++ b/packages/persistent-merkle-tree/test/unit/gindex.test.ts @@ -10,7 +10,7 @@ import { Bit, getGindicesAtDepth, getGindexBits, -} from "../../src"; +} from "../../src/index.js"; describe("countToDepth", () => { const testCases = [ diff --git a/packages/persistent-merkle-tree/test/unit/hashComputation.test.ts b/packages/persistent-merkle-tree/test/unit/hashComputation.test.ts index da2a5150f..ac2283957 100644 --- a/packages/persistent-merkle-tree/test/unit/hashComputation.test.ts +++ b/packages/persistent-merkle-tree/test/unit/hashComputation.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { zeroNode, Node } from "../../src"; +import { zeroNode, Node } from "../../src/index.js"; import {HashComputationLevel} from "../../src/hashComputation"; describe("HashComputationLevel", () => { diff --git a/packages/persistent-merkle-tree/test/unit/hasher.test.ts b/packages/persistent-merkle-tree/test/unit/hasher.test.ts index 6205bd563..20857aef4 100644 --- a/packages/persistent-merkle-tree/test/unit/hasher.test.ts +++ b/packages/persistent-merkle-tree/test/unit/hasher.test.ts @@ -5,7 +5,7 @@ import {hasher as asSha256Hasher} from "../../src/hasher/as-sha256"; import {hasher as hashtreeHasher} from "../../src/hasher/hashtree"; import {linspace} from "../utils/misc"; import {buildComparisonTrees} from "../utils/tree"; -import {HashComputationLevel, HashObject, LeafNode, getHashComputations, subtreeFillToContents} from "../../src"; +import {HashComputationLevel, HashObject, LeafNode, getHashComputations, subtreeFillToContents} from "../../src/index.js"; import { expect } from "chai"; import { zeroHash } from "../../src/zeroHash"; diff --git a/packages/persistent-merkle-tree/test/unit/node.test.ts b/packages/persistent-merkle-tree/test/unit/node.test.ts index 1fbcb54e5..50b328567 100644 --- a/packages/persistent-merkle-tree/test/unit/node.test.ts +++ b/packages/persistent-merkle-tree/test/unit/node.test.ts @@ -1,6 +1,6 @@ import {HashObject} from "@chainsafe/as-sha256"; import {expect} from "chai"; -import {BranchNode, LeafNode, countToDepth, subtreeFillToContents} from "../../src"; +import {BranchNode, LeafNode, countToDepth, subtreeFillToContents} from "../../src/index.js"; import {HashComputation, HashComputationLevel, getHashComputations} from "../../src/hashComputation"; describe("LeafNode uint", () => { diff --git a/packages/persistent-merkle-tree/test/unit/packedNode.test.ts b/packages/persistent-merkle-tree/test/unit/packedNode.test.ts index 0fb53ac91..e0fe6b206 100644 --- a/packages/persistent-merkle-tree/test/unit/packedNode.test.ts +++ b/packages/persistent-merkle-tree/test/unit/packedNode.test.ts @@ -1,6 +1,6 @@ import {HashObject} from "@chainsafe/as-sha256"; import {expect} from "chai"; -import {LeafNode, Node} from "../../src"; +import {LeafNode, Node} from "../../src/index.js"; import {packedNodeRootsToBytes, packedRootsBytesToLeafNodes, packedUintNum64sToLeafNodes} from "../../src/packedNode"; describe("subtree / packedNode single node", () => { diff --git a/packages/persistent-merkle-tree/test/unit/snapshot.test.ts b/packages/persistent-merkle-tree/test/unit/snapshot.test.ts index 4747335e5..ae7b6d580 100644 --- a/packages/persistent-merkle-tree/test/unit/snapshot.test.ts +++ b/packages/persistent-merkle-tree/test/unit/snapshot.test.ts @@ -4,7 +4,7 @@ import {fromSnapshot, indexToFinalizedGindices, toSnapshot} from "../../src/snap import {subtreeFillToContents} from "../../src/subtree"; import { LeafNode } from "../../src/node"; import { Tree, setNodesAtDepth } from "../../src/tree"; -import { toGindex } from "../../src"; +import { toGindex } from "../../src/index.js"; describe("toSnapshot and fromSnapshot", () => { const depth = 4; diff --git a/packages/persistent-merkle-tree/test/unit/subtree.test.ts b/packages/persistent-merkle-tree/test/unit/subtree.test.ts index d46f7ad6c..f32167b88 100644 --- a/packages/persistent-merkle-tree/test/unit/subtree.test.ts +++ b/packages/persistent-merkle-tree/test/unit/subtree.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import {subtreeFillToContents, LeafNode, getNodesAtDepth, executeHashComputations, BranchNode, Node, HashComputationLevel, zeroNode} from "../../src"; +import {subtreeFillToContents, LeafNode, getNodesAtDepth, executeHashComputations, BranchNode, Node, HashComputationLevel, zeroNode} from "../../src/index.js"; describe("subtreeFillToContents", function () { // the hash computation takes time diff --git a/packages/persistent-merkle-tree/test/unit/tree.test.ts b/packages/persistent-merkle-tree/test/unit/tree.test.ts index 707c692aa..de62bd0ba 100644 --- a/packages/persistent-merkle-tree/test/unit/tree.test.ts +++ b/packages/persistent-merkle-tree/test/unit/tree.test.ts @@ -12,7 +12,7 @@ import { findDiffDepthi, getHashComputations, HashComputationLevel, -} from "../../src"; +} from "../../src/index.js"; import {batchHash} from "../utils/batchHash"; describe("fixed-depth tree iteration", () => { diff --git a/packages/persistent-merkle-tree/test/unit/tree/getNodes.test.ts b/packages/persistent-merkle-tree/test/unit/tree/getNodes.test.ts index 8b0cf428a..5b9298f99 100644 --- a/packages/persistent-merkle-tree/test/unit/tree/getNodes.test.ts +++ b/packages/persistent-merkle-tree/test/unit/tree/getNodes.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {getNodesAtDepth, LeafNode, Node, subtreeFillToContents, Tree} from "../../../src"; +import {getNodesAtDepth, LeafNode, Node, subtreeFillToContents, Tree} from "../../../src/index.js"; describe("tree / getNodes", () => { const depth = 40; diff --git a/packages/persistent-merkle-tree/test/unit/tree/zeroAfterIndex.test.ts b/packages/persistent-merkle-tree/test/unit/tree/zeroAfterIndex.test.ts index 51b858bea..88490658c 100644 --- a/packages/persistent-merkle-tree/test/unit/tree/zeroAfterIndex.test.ts +++ b/packages/persistent-merkle-tree/test/unit/tree/zeroAfterIndex.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {LeafNode, Node, toGindex, Tree, zeroNode, treeZeroAfterIndex, getNodesAtDepth} from "../../../src"; +import {LeafNode, Node, toGindex, Tree, zeroNode, treeZeroAfterIndex, getNodesAtDepth} from "../../../src/index.js"; describe("tree / zeroAfterIndex", () => { // Test all possible zeroAfterIndex operations for any tree with 0 <= depth < 6 diff --git a/packages/persistent-merkle-tree/test/utils/tree.ts b/packages/persistent-merkle-tree/test/utils/tree.ts index 19c50bd80..a5509c327 100644 --- a/packages/persistent-merkle-tree/test/utils/tree.ts +++ b/packages/persistent-merkle-tree/test/utils/tree.ts @@ -1,4 +1,4 @@ -import {subtreeFillToContents} from "../../src"; +import {subtreeFillToContents} from "../../src/index.js"; import {BranchNode, LeafNode, Node} from "../../src/node"; import {linspace} from "./misc"; diff --git a/packages/persistent-ts/package.json b/packages/persistent-ts/package.json index 33336d9db..341d85560 100644 --- a/packages/persistent-ts/package.json +++ b/packages/persistent-ts/package.json @@ -13,7 +13,7 @@ ], "scripts": { "clean": "rm -rf lib", - "build": "yarn build:cjs && yarn build:esm", + "build": "yarn build:cjs && yarn build:esm && yarn build:types", "build:esm": "tsc -p tsconfig.build.esm.json && echo '{\"type\": \"module\"}' > ./lib/esm/package.json", "build:cjs": "tsc -p tsconfig.build.cjs.json && echo '{\"type\": \"commonjs\"}' > ./lib/cjs/package.json", "build:types": "tsc -p tsconfig.build.types.json", diff --git a/packages/simpleserialize.com/src/components/Input.tsx b/packages/simpleserialize.com/src/components/Input.tsx index 4017189cb..73bab9c81 100644 --- a/packages/simpleserialize.com/src/components/Input.tsx +++ b/packages/simpleserialize.com/src/components/Input.tsx @@ -7,7 +7,7 @@ import {ChangeEvent} from "react"; import {AlertManager, withAlert} from "react-alert"; import {inputTypes} from "../util/input_types"; -import {ForkName, typeNames, forks} from "../util/types"; +import {ForkName, typeNames, forks} from "../util/types.js"; import {SszWorker} from "./worker"; const initialType = "BeaconBlock"; @@ -33,7 +33,7 @@ type State = { userHasEditedInput: boolean; }; -const DEFAULT_FORK = "deneb"; +const DEFAULT_FORK = "deneb/index.js"; class Input extends React.Component { worker: Worker; diff --git a/packages/simpleserialize.com/src/components/Serialize.tsx b/packages/simpleserialize.com/src/components/Serialize.tsx index a3e3c8435..ca30cc258 100644 --- a/packages/simpleserialize.com/src/components/Serialize.tsx +++ b/packages/simpleserialize.com/src/components/Serialize.tsx @@ -4,7 +4,7 @@ import Output from "./Output"; import Input from "./Input"; import LoadingOverlay from "react-loading-overlay"; import BounceLoader from "react-spinners/BounceLoader"; -import {ForkName} from "../util/types"; +import {ForkName} from "../util/types.js"; import {ModuleThread, spawn, Thread, Worker} from "threads"; import {SszWorker} from "./worker"; diff --git a/packages/simpleserialize.com/src/components/TreeView.tsx b/packages/simpleserialize.com/src/components/TreeView.tsx index db329575d..a6795d44d 100644 --- a/packages/simpleserialize.com/src/components/TreeView.tsx +++ b/packages/simpleserialize.com/src/components/TreeView.tsx @@ -19,7 +19,7 @@ import { isContainerType, } from "@chainsafe/ssz"; import BN from "bn.js"; -import { ForkName, forks } from "../util/types"; +import { ForkName, forks } from "../util/types.js"; function getTypeName(type: Type, types: Record>, name: string): string | undefined { if(isBooleanType(type)) return "bool"; diff --git a/packages/simpleserialize.com/src/components/worker/helpers.ts b/packages/simpleserialize.com/src/components/worker/helpers.ts index 0e8032e44..4923e86c9 100644 --- a/packages/simpleserialize.com/src/components/worker/helpers.ts +++ b/packages/simpleserialize.com/src/components/worker/helpers.ts @@ -1,5 +1,5 @@ import {Type} from "@chainsafe/ssz"; -import {forks} from "../../util/types"; +import {forks} from "../../util/types.js"; // type primitiveType = boolean | number | bigint | Uint8Array | Array | object | undefined; diff --git a/packages/simpleserialize.com/src/util/types.ts b/packages/simpleserialize.com/src/util/types.ts index 15aa5c9ac..ac5c1155a 100644 --- a/packages/simpleserialize.com/src/util/types.ts +++ b/packages/simpleserialize.com/src/util/types.ts @@ -10,16 +10,7 @@ import { } from "@chainsafe/ssz"; import {ssz} from "@lodestar/types"; -let { - phase0, - altair, - bellatrix, - capella, - deneb, - electra, - sszTypesFor, - ...primitive -} = ssz; +let {phase0, altair, bellatrix, capella, deneb, electra, sszTypesFor, ...primitive} = ssz; phase0 = patchSszTypes(phase0); altair = patchSszTypes(altair); diff --git a/packages/ssz/test/lodestarTypes/allForks/index.ts b/packages/ssz/test/lodestarTypes/allForks/index.ts index a1361536e..7856cd729 100644 --- a/packages/ssz/test/lodestarTypes/allForks/index.ts +++ b/packages/ssz/test/lodestarTypes/allForks/index.ts @@ -1,3 +1,3 @@ -export * from "./types"; -export * as ts from "./types"; -export * as ssz from "./sszTypes"; +export * from "./types.js"; +export * as ts from "./types.js"; +export * as ssz from "./sszTypes.js"; diff --git a/packages/ssz/test/lodestarTypes/allForks/sszTypes.ts b/packages/ssz/test/lodestarTypes/allForks/sszTypes.ts index 8e360d512..023d7bc86 100644 --- a/packages/ssz/test/lodestarTypes/allForks/sszTypes.ts +++ b/packages/ssz/test/lodestarTypes/allForks/sszTypes.ts @@ -1,8 +1,8 @@ -import {ssz as phase0} from "../phase0"; -import {ssz as altair} from "../altair"; -import {ssz as bellatrix} from "../bellatrix"; -import {ssz as capella} from "../capella"; -import {ssz as deneb} from "../deneb"; +import {ssz as phase0} from "../phase0/index.js"; +import {ssz as altair} from "../altair/index.js"; +import {ssz as bellatrix} from "../bellatrix/index.js"; +import {ssz as capella} from "../capella/index.js"; +import {ssz as deneb} from "../deneb/index.js"; /** * Index the ssz types that differ by fork diff --git a/packages/ssz/test/lodestarTypes/allForks/types.ts b/packages/ssz/test/lodestarTypes/allForks/types.ts index 161a87e06..ec78694ee 100644 --- a/packages/ssz/test/lodestarTypes/allForks/types.ts +++ b/packages/ssz/test/lodestarTypes/allForks/types.ts @@ -1,15 +1,15 @@ -import {CompositeType, ContainerType, ValueOf, CompositeView, CompositeViewDU} from "../../../src"; -import {ts as phase0} from "../phase0"; -import {ts as altair} from "../altair"; -import {ts as bellatrix} from "../bellatrix"; -import {ts as capella} from "../capella"; -import {ts as deneb} from "../deneb"; +import {CompositeType, ContainerType, ValueOf, CompositeView, CompositeViewDU} from "../../../src/index.js"; +import {ts as phase0} from "../phase0/index.js"; +import {ts as altair} from "../altair/index.js"; +import {ts as bellatrix} from "../bellatrix/index.js"; +import {ts as capella} from "../capella/index.js"; +import {ts as deneb} from "../deneb/index.js"; -import {ssz as phase0Ssz} from "../phase0"; -import {ssz as altairSsz} from "../altair"; -import {ssz as bellatrixSsz} from "../bellatrix"; -import {ssz as capellaSsz} from "../capella"; -import {ssz as denebSsz} from "../deneb"; +import {ssz as phase0Ssz} from "../phase0/index.js"; +import {ssz as altairSsz} from "../altair/index.js"; +import {ssz as bellatrixSsz} from "../bellatrix/index.js"; +import {ssz as capellaSsz} from "../capella/index.js"; +import {ssz as denebSsz} from "../deneb/index.js"; // Re-export union types for types that are _known_ to differ diff --git a/packages/ssz/test/lodestarTypes/altair/index.ts b/packages/ssz/test/lodestarTypes/altair/index.ts index a1361536e..7856cd729 100644 --- a/packages/ssz/test/lodestarTypes/altair/index.ts +++ b/packages/ssz/test/lodestarTypes/altair/index.ts @@ -1,3 +1,3 @@ -export * from "./types"; -export * as ts from "./types"; -export * as ssz from "./sszTypes"; +export * from "./types.js"; +export * as ts from "./types.js"; +export * as ssz from "./sszTypes.js"; diff --git a/packages/ssz/test/lodestarTypes/altair/sszTypes.ts b/packages/ssz/test/lodestarTypes/altair/sszTypes.ts index 715220e55..2a21a4c1a 100644 --- a/packages/ssz/test/lodestarTypes/altair/sszTypes.ts +++ b/packages/ssz/test/lodestarTypes/altair/sszTypes.ts @@ -1,5 +1,5 @@ -import {BitVectorType, ContainerType, ListBasicType, ListCompositeType, VectorCompositeType} from "../../../src"; -import {preset, FINALIZED_ROOT_DEPTH, NEXT_SYNC_COMMITTEE_DEPTH, SYNC_COMMITTEE_SUBNET_COUNT} from "../params"; +import {BitVectorType, ContainerType, ListBasicType, ListCompositeType, VectorCompositeType} from "../../../src/index.js"; +import {preset, FINALIZED_ROOT_DEPTH, NEXT_SYNC_COMMITTEE_DEPTH, SYNC_COMMITTEE_SUBNET_COUNT} from "../params.js"; const { SYNC_COMMITTEE_SIZE, HISTORICAL_ROOTS_LIMIT, @@ -7,8 +7,8 @@ const { EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH, } = preset; -import * as phase0Ssz from "../phase0/sszTypes"; -import * as primitiveSsz from "../primitive/sszTypes"; +import * as phase0Ssz from "../phase0/sszTypes.js"; +import * as primitiveSsz from "../primitive/sszTypes.js"; const { Bytes32, diff --git a/packages/ssz/test/lodestarTypes/altair/types.ts b/packages/ssz/test/lodestarTypes/altair/types.ts index e824d5f97..02adaa27e 100644 --- a/packages/ssz/test/lodestarTypes/altair/types.ts +++ b/packages/ssz/test/lodestarTypes/altair/types.ts @@ -1,5 +1,5 @@ -import {ValueOf} from "../../../src"; -import * as ssz from "./sszTypes"; +import {ValueOf} from "../../../src/index.js"; +import * as ssz from "./sszTypes.js"; export type SyncSubnets = ValueOf; export type Metadata = ValueOf; diff --git a/packages/ssz/test/lodestarTypes/bellatrix/index.ts b/packages/ssz/test/lodestarTypes/bellatrix/index.ts index a1361536e..7856cd729 100644 --- a/packages/ssz/test/lodestarTypes/bellatrix/index.ts +++ b/packages/ssz/test/lodestarTypes/bellatrix/index.ts @@ -1,3 +1,3 @@ -export * from "./types"; -export * as ts from "./types"; -export * as ssz from "./sszTypes"; +export * from "./types.js"; +export * as ts from "./types.js"; +export * as ssz from "./sszTypes.js"; diff --git a/packages/ssz/test/lodestarTypes/bellatrix/sszTypes.ts b/packages/ssz/test/lodestarTypes/bellatrix/sszTypes.ts index 868aabe9a..1f90566ce 100644 --- a/packages/ssz/test/lodestarTypes/bellatrix/sszTypes.ts +++ b/packages/ssz/test/lodestarTypes/bellatrix/sszTypes.ts @@ -1,9 +1,9 @@ -import {ByteListType, ByteVectorType, ContainerType, ListCompositeType} from "../../../src"; -import {preset} from "../params"; -import {ssz as primitiveSsz} from "../primitive"; -import {ssz as phase0Ssz} from "../phase0"; -import {ssz as altairSsz} from "../altair"; -import {stringType} from "../utils/StringType"; +import {ByteListType, ByteVectorType, ContainerType, ListCompositeType} from "../../../src/index.js"; +import {preset} from "../params.js"; +import {ssz as primitiveSsz} from "../primitive/index.js"; +import {ssz as phase0Ssz} from "../phase0/index.js"; +import {ssz as altairSsz} from "../altair/index.js"; +import {stringType} from "../utils/StringType.js"; const { BYTES_PER_LOGS_BLOOM, HISTORICAL_ROOTS_LIMIT, diff --git a/packages/ssz/test/lodestarTypes/bellatrix/types.ts b/packages/ssz/test/lodestarTypes/bellatrix/types.ts index cd02d1103..ea05bfc56 100644 --- a/packages/ssz/test/lodestarTypes/bellatrix/types.ts +++ b/packages/ssz/test/lodestarTypes/bellatrix/types.ts @@ -1,5 +1,5 @@ -import {ValueOf} from "../../../src"; -import * as ssz from "./sszTypes"; +import {ValueOf} from "../../../src/index.js"; +import * as ssz from "./sszTypes.js"; export type Transaction = ValueOf; export type Transactions = ValueOf; diff --git a/packages/ssz/test/lodestarTypes/capella/index.ts b/packages/ssz/test/lodestarTypes/capella/index.ts index a1361536e..7856cd729 100644 --- a/packages/ssz/test/lodestarTypes/capella/index.ts +++ b/packages/ssz/test/lodestarTypes/capella/index.ts @@ -1,3 +1,3 @@ -export * from "./types"; -export * as ts from "./types"; -export * as ssz from "./sszTypes"; +export * from "./types.js"; +export * as ts from "./types.js"; +export * as ssz from "./sszTypes.js"; diff --git a/packages/ssz/test/lodestarTypes/capella/sszTypes.ts b/packages/ssz/test/lodestarTypes/capella/sszTypes.ts index 73caab2e8..0d8840eed 100644 --- a/packages/ssz/test/lodestarTypes/capella/sszTypes.ts +++ b/packages/ssz/test/lodestarTypes/capella/sszTypes.ts @@ -1,9 +1,9 @@ -import {ContainerType, ListCompositeType, VectorCompositeType} from "../../../src"; -import {preset, BLOCK_BODY_EXECUTION_PAYLOAD_DEPTH as EXECUTION_PAYLOAD_DEPTH} from "../params"; -import {ssz as primitiveSsz} from "../primitive"; -import {ssz as phase0Ssz} from "../phase0"; -import {ssz as altairSsz} from "../altair"; -import {ssz as bellatrixSsz} from "../bellatrix"; +import {ContainerType, ListCompositeType, VectorCompositeType} from "../../../src/index.js"; +import {preset, BLOCK_BODY_EXECUTION_PAYLOAD_DEPTH as EXECUTION_PAYLOAD_DEPTH} from "../params.js"; +import {ssz as primitiveSsz} from "../primitive/index.js"; +import {ssz as phase0Ssz} from "../phase0/index.js"; +import {ssz as altairSsz} from "../altair/index.js"; +import {ssz as bellatrixSsz} from "../bellatrix/index.js"; const { HISTORICAL_ROOTS_LIMIT, MAX_WITHDRAWALS_PER_PAYLOAD, diff --git a/packages/ssz/test/lodestarTypes/capella/types.ts b/packages/ssz/test/lodestarTypes/capella/types.ts index 9f3cb33e2..adc1a6583 100644 --- a/packages/ssz/test/lodestarTypes/capella/types.ts +++ b/packages/ssz/test/lodestarTypes/capella/types.ts @@ -1,5 +1,5 @@ -import {ValueOf} from "../../../src"; -import * as ssz from "./sszTypes"; +import {ValueOf} from "../../../src/index.js"; +import * as ssz from "./sszTypes.js"; export type Withdrawal = ValueOf; export type Withdrawals = ValueOf; diff --git a/packages/ssz/test/lodestarTypes/deneb/index.ts b/packages/ssz/test/lodestarTypes/deneb/index.ts index a1361536e..7856cd729 100644 --- a/packages/ssz/test/lodestarTypes/deneb/index.ts +++ b/packages/ssz/test/lodestarTypes/deneb/index.ts @@ -1,3 +1,3 @@ -export * from "./types"; -export * as ts from "./types"; -export * as ssz from "./sszTypes"; +export * from "./types.js"; +export * as ts from "./types.js"; +export * as ssz from "./sszTypes.js"; diff --git a/packages/ssz/test/lodestarTypes/deneb/sszTypes.ts b/packages/ssz/test/lodestarTypes/deneb/sszTypes.ts index bbc760ad1..4fd26bc75 100644 --- a/packages/ssz/test/lodestarTypes/deneb/sszTypes.ts +++ b/packages/ssz/test/lodestarTypes/deneb/sszTypes.ts @@ -1,15 +1,15 @@ -import {ContainerType, ListCompositeType, ByteVectorType, VectorCompositeType} from "../../../src"; +import {ContainerType, ListCompositeType, ByteVectorType, VectorCompositeType} from "../../../src/index.js"; import { preset, BYTES_PER_FIELD_ELEMENT, BLOCK_BODY_EXECUTION_PAYLOAD_DEPTH as EXECUTION_PAYLOAD_DEPTH, MAX_REQUEST_BLOCKS_DENEB, -} from "../params"; -import {ssz as primitiveSsz} from "../primitive"; -import {ssz as phase0Ssz} from "../phase0"; -import {ssz as altairSsz} from "../altair"; -import {ssz as bellatrixSsz} from "../bellatrix"; -import {ssz as capellaSsz} from "../capella"; +} from "../params.js"; +import {ssz as primitiveSsz} from "../primitive/index.js"; +import {ssz as phase0Ssz} from "../phase0/index.js"; +import {ssz as altairSsz} from "../altair/index.js"; +import {ssz as bellatrixSsz} from "../bellatrix/index.js"; +import {ssz as capellaSsz} from "../capella/index.js"; const { HISTORICAL_ROOTS_LIMIT, MAX_BLOB_COMMITMENTS_PER_BLOCK, diff --git a/packages/ssz/test/lodestarTypes/deneb/types.ts b/packages/ssz/test/lodestarTypes/deneb/types.ts index 4f550be98..0f544ef4f 100644 --- a/packages/ssz/test/lodestarTypes/deneb/types.ts +++ b/packages/ssz/test/lodestarTypes/deneb/types.ts @@ -1,5 +1,5 @@ -import {ValueOf} from "../../../src"; -import * as ssz from "./sszTypes"; +import {ValueOf} from "../../../src/index.js"; +import * as ssz from "./sszTypes.js"; export type KZGProof = ValueOf; export type KZGCommitment = ValueOf; diff --git a/packages/ssz/test/lodestarTypes/index.ts b/packages/ssz/test/lodestarTypes/index.ts index 4fa87b3a2..825b962c5 100644 --- a/packages/ssz/test/lodestarTypes/index.ts +++ b/packages/ssz/test/lodestarTypes/index.ts @@ -1,6 +1,6 @@ -export * from "./types"; -export * as ssz from "./sszTypes"; +export * from "./types.js"; +export * as ssz from "./sszTypes.js"; // Typeguards -export * from "./utils/typeguards"; +export * from "./utils/typeguards.js"; // String type -export {StringType, stringType} from "./utils/StringType"; +export {StringType, stringType} from "./utils/StringType.js"; diff --git a/packages/ssz/test/lodestarTypes/phase0/index.ts b/packages/ssz/test/lodestarTypes/phase0/index.ts index a1361536e..7856cd729 100644 --- a/packages/ssz/test/lodestarTypes/phase0/index.ts +++ b/packages/ssz/test/lodestarTypes/phase0/index.ts @@ -1,3 +1,3 @@ -export * from "./types"; -export * as ts from "./types"; -export * as ssz from "./sszTypes"; +export * from "./types.js"; +export * as ts from "./types.js"; +export * as ssz from "./sszTypes.js"; diff --git a/packages/ssz/test/lodestarTypes/phase0/sszTypes.ts b/packages/ssz/test/lodestarTypes/phase0/sszTypes.ts index d3e6b4a39..077359d2f 100644 --- a/packages/ssz/test/lodestarTypes/phase0/sszTypes.ts +++ b/packages/ssz/test/lodestarTypes/phase0/sszTypes.ts @@ -7,17 +7,17 @@ import { ListCompositeType, VectorBasicType, VectorCompositeType, -} from "../../../src"; -import {ListUintNum64Type} from "../../../src/type/listUintNum64"; -import {PartialListCompositeType} from "../../../src/type/partialListComposite"; +} from "../../../src/index.js"; +import {ListUintNum64Type} from "../../../src/type/listUintNum64.js"; +import {PartialListCompositeType} from "../../../src/type/partialListComposite.js"; import { preset, MAX_REQUEST_BLOCKS, DEPOSIT_CONTRACT_TREE_DEPTH, JUSTIFICATION_BITS_LENGTH, ATTESTATION_SUBNET_COUNT, -} from "../params"; -import * as primitiveSsz from "../primitive/sszTypes"; +} from "../params.js"; +import * as primitiveSsz from "../primitive/sszTypes.js"; const { EPOCHS_PER_ETH1_VOTING_PERIOD, diff --git a/packages/ssz/test/lodestarTypes/phase0/types.ts b/packages/ssz/test/lodestarTypes/phase0/types.ts index dc877ead9..6fb6305ae 100644 --- a/packages/ssz/test/lodestarTypes/phase0/types.ts +++ b/packages/ssz/test/lodestarTypes/phase0/types.ts @@ -1,5 +1,5 @@ -import {ValueOf} from "../../../src"; -import * as ssz from "./sszTypes"; +import {ValueOf} from "../../../src/index.js"; +import * as ssz from "./sszTypes.js"; export type AttestationSubnets = ValueOf; export type BeaconBlockHeader = ValueOf; diff --git a/packages/ssz/test/lodestarTypes/primitive/index.ts b/packages/ssz/test/lodestarTypes/primitive/index.ts index 0a5a58754..2953a04f1 100644 --- a/packages/ssz/test/lodestarTypes/primitive/index.ts +++ b/packages/ssz/test/lodestarTypes/primitive/index.ts @@ -1,2 +1,2 @@ -export * as ts from "./types"; -export * as ssz from "./sszTypes"; +export * as ts from "./types.js"; +export * as ssz from "./sszTypes.js"; diff --git a/packages/ssz/test/lodestarTypes/primitive/sszTypes.ts b/packages/ssz/test/lodestarTypes/primitive/sszTypes.ts index 61d4f1623..7daf53896 100644 --- a/packages/ssz/test/lodestarTypes/primitive/sszTypes.ts +++ b/packages/ssz/test/lodestarTypes/primitive/sszTypes.ts @@ -1,4 +1,4 @@ -import {ByteVectorType, UintNumberType, UintBigintType, BooleanType} from "../../../src"; +import {ByteVectorType, UintNumberType, UintBigintType, BooleanType} from "../../../src/index.js"; export const Boolean = new BooleanType(); export const Byte = new UintNumberType(1); diff --git a/packages/ssz/test/lodestarTypes/primitive/types.ts b/packages/ssz/test/lodestarTypes/primitive/types.ts index a4314d3eb..e74ac31f8 100644 --- a/packages/ssz/test/lodestarTypes/primitive/types.ts +++ b/packages/ssz/test/lodestarTypes/primitive/types.ts @@ -1,5 +1,5 @@ -import {ValueOf} from "../../../src"; -import * as ssz from "./sszTypes"; +import {ValueOf} from "../../../src/index.js"; +import * as ssz from "./sszTypes.js"; // Each type exported here contains both a compile-time type // (a typescript interface) and a run-time ssz type (a javascript variable) diff --git a/packages/ssz/test/lodestarTypes/sszTypes.ts b/packages/ssz/test/lodestarTypes/sszTypes.ts index 9e0fd4090..2a7df948a 100644 --- a/packages/ssz/test/lodestarTypes/sszTypes.ts +++ b/packages/ssz/test/lodestarTypes/sszTypes.ts @@ -1,11 +1,11 @@ -export * from "./primitive/sszTypes"; -export {ssz as phase0} from "./phase0"; -export {ssz as altair} from "./altair"; -export {ssz as bellatrix} from "./bellatrix"; -export {ssz as capella} from "./capella"; -export {ssz as deneb} from "./deneb"; +export * from "./primitive/sszTypes.js"; +export {ssz as phase0} from "./phase0/index.js"; +export {ssz as altair} from "./altair/index.js"; +export {ssz as bellatrix} from "./bellatrix/index.js"; +export {ssz as capella} from "./capella/index.js"; +export {ssz as deneb} from "./deneb/index.js"; -import {ssz as allForksSsz} from "./allForks"; +import {ssz as allForksSsz} from "./allForks/index.js"; export const allForks = allForksSsz.allForks; export const allForksBlinded = allForksSsz.allForksBlinded; export const allForksExecution = allForksSsz.allForksExecution; diff --git a/packages/ssz/test/lodestarTypes/types.ts b/packages/ssz/test/lodestarTypes/types.ts index 477ee9c40..e2e416fa3 100644 --- a/packages/ssz/test/lodestarTypes/types.ts +++ b/packages/ssz/test/lodestarTypes/types.ts @@ -1,13 +1,13 @@ -import {Slot} from "./primitive/types"; +import {Slot} from "./primitive/types.js"; -export * from "./primitive/types"; -export {ts as phase0} from "./phase0"; -export {ts as altair} from "./altair"; -export {ts as bellatrix} from "./bellatrix"; -export {ts as capella} from "./capella"; -export {ts as deneb} from "./deneb"; +export * from "./primitive/types.js"; +export {ts as phase0} from "./phase0/index.js"; +export {ts as altair} from "./altair/index.js"; +export {ts as bellatrix} from "./bellatrix/index.js"; +export {ts as capella} from "./capella/index.js"; +export {ts as deneb} from "./deneb/index.js"; -export {ts as allForks} from "./allForks"; +export {ts as allForks} from "./allForks/index.js"; /** Common non-spec type to represent roots as strings */ export type RootHex = string; diff --git a/packages/ssz/test/lodestarTypes/utils/StringType.ts b/packages/ssz/test/lodestarTypes/utils/StringType.ts index 0c60a0a9f..14a30341d 100644 --- a/packages/ssz/test/lodestarTypes/utils/StringType.ts +++ b/packages/ssz/test/lodestarTypes/utils/StringType.ts @@ -1,4 +1,4 @@ -import {BasicType} from "../../../src"; +import {BasicType} from "../../../src/index.js"; export class StringType extends BasicType { readonly typeName = "string"; diff --git a/packages/ssz/test/lodestarTypes/utils/typeguards.ts b/packages/ssz/test/lodestarTypes/utils/typeguards.ts index 09d79ac36..0303caa10 100644 --- a/packages/ssz/test/lodestarTypes/utils/typeguards.ts +++ b/packages/ssz/test/lodestarTypes/utils/typeguards.ts @@ -8,9 +8,9 @@ import { FullOrBlindedSignedBlobSidecar, BlindedBeaconBlockBody, BlindedBeaconBlock, -} from "../allForks/types"; -import {ts as bellatrix} from "../bellatrix"; -import {ts as deneb} from "../deneb"; +} from "../allForks/types.js"; +import {ts as bellatrix} from "../bellatrix/index.js"; +import {ts as deneb} from "../deneb/index.js"; export function isBlindedExecution(payload: FullOrBlindedExecutionPayload): payload is ExecutionPayloadHeader { // we just check transactionsRoot for determinging as it the base field diff --git a/packages/ssz/test/memory/bytes.test.ts b/packages/ssz/test/memory/bytes.test.ts index 7843ba1e3..efff0e0d8 100644 --- a/packages/ssz/test/memory/bytes.test.ts +++ b/packages/ssz/test/memory/bytes.test.ts @@ -1,5 +1,5 @@ import {LeafNode} from "@chainsafe/persistent-merkle-tree"; -import {testRunnerMemory} from "./testRunnerMemory"; +import {testRunnerMemory} from "./testRunnerMemory.js"; /* eslint-disable no-console */ diff --git a/packages/ssz/test/memory/eth2Objects.test.ts b/packages/ssz/test/memory/eth2Objects.test.ts index 21b53490f..c50909da0 100644 --- a/packages/ssz/test/memory/eth2Objects.test.ts +++ b/packages/ssz/test/memory/eth2Objects.test.ts @@ -1,11 +1,11 @@ -import {testRunnerMemory} from "./testRunnerMemory"; -import {ssz} from "../lodestarTypes/phase0"; +import {testRunnerMemory} from "./testRunnerMemory.js"; +import {ssz} from "../lodestarTypes/phase0/index.js"; import { getAttestation, getSignedAggregateAndProof, getBitsSingle, getSignedBeaconBlockPhase0, -} from "../utils/generateEth2Objs"; +} from "../utils/generateEth2Objs.js"; // Results in Linux Dec 2021 // diff --git a/packages/ssz/test/memory/hooks.test.ts b/packages/ssz/test/memory/hooks.test.ts index 7be2a18d4..8f6314759 100644 --- a/packages/ssz/test/memory/hooks.test.ts +++ b/packages/ssz/test/memory/hooks.test.ts @@ -1,4 +1,4 @@ -import {testRunnerMemory} from "./testRunnerMemory"; +import {testRunnerMemory} from "./testRunnerMemory.js"; // Results in Linux Dec 2021 // diff --git a/packages/ssz/test/memory/treeView.test.ts b/packages/ssz/test/memory/treeView.test.ts index e3532a69f..48a71fd58 100644 --- a/packages/ssz/test/memory/treeView.test.ts +++ b/packages/ssz/test/memory/treeView.test.ts @@ -1,6 +1,6 @@ import {LeafNode, Tree, zeroNode} from "@chainsafe/persistent-merkle-tree"; import {MutableVector} from "@chainsafe/persistent-ts"; -import {testRunnerMemory} from "./testRunnerMemory"; +import {testRunnerMemory} from "./testRunnerMemory.js"; // Results in Linux Dec 2021 // diff --git a/packages/ssz/test/perf/bitlist.test.ts b/packages/ssz/test/perf/bitlist.test.ts index fce2a3530..f0bbea172 100644 --- a/packages/ssz/test/perf/bitlist.test.ts +++ b/packages/ssz/test/perf/bitlist.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {BitArray, BitListType} from "../../src"; +import {BitArray, BitListType} from "../../src/index.js"; // running zipIndexesCommitteeBits() on `bitLen: 2048, bitsSet: 2048` takes 50.904 us/op // However deserializing a BitList to struct `len 2048, set 2048` takes 560.4670 us/op, diff --git a/packages/ssz/test/perf/byType/listBasic.test.ts b/packages/ssz/test/perf/byType/listBasic.test.ts index c33b7069b..896efeeb4 100644 --- a/packages/ssz/test/perf/byType/listBasic.test.ts +++ b/packages/ssz/test/perf/byType/listBasic.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {ListBasicType, UintNumberType} from "../../../src"; +import {ListBasicType, UintNumberType} from "../../../src/index.js"; const byteType = new UintNumberType(1); diff --git a/packages/ssz/test/perf/byType/listComposite.test.ts b/packages/ssz/test/perf/byType/listComposite.test.ts index dbf759884..61b5de6cc 100644 --- a/packages/ssz/test/perf/byType/listComposite.test.ts +++ b/packages/ssz/test/perf/byType/listComposite.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {ContainerNodeStructType, ContainerType, ListCompositeType, UintNumberType} from "../../../src"; +import {ContainerNodeStructType, ContainerType, ListCompositeType, UintNumberType} from "../../../src/index.js"; const byteType = new UintNumberType(1); diff --git a/packages/ssz/test/perf/bytelist.test.ts b/packages/ssz/test/perf/bytelist.test.ts index 56c9eba90..f0bbb9e0e 100644 --- a/packages/ssz/test/perf/bytelist.test.ts +++ b/packages/ssz/test/perf/bytelist.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {ByteListType, ListBasicType, UintNumberType} from "../../src"; +import {ByteListType, ListBasicType, UintNumberType} from "../../src/index.js"; describe("ByteListType vs BasicListType", () => { const limit = 256 * 2; diff --git a/packages/ssz/test/perf/cacheMutableRootStruct.test.ts b/packages/ssz/test/perf/cacheMutableRootStruct.test.ts index 5b5979266..407bc2719 100644 --- a/packages/ssz/test/perf/cacheMutableRootStruct.test.ts +++ b/packages/ssz/test/perf/cacheMutableRootStruct.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {BitVectorType, ContainerType, UintBigintType, ValueOf} from "../../src"; +import {BitVectorType, ContainerType, UintBigintType, ValueOf} from "../../src/index.js"; describe("cachePermanentRootStruct", () => { const uint64 = new UintBigintType(8); diff --git a/packages/ssz/test/perf/epochStatuses.test.ts b/packages/ssz/test/perf/epochStatuses.test.ts index 28d62857d..e033f60e9 100644 --- a/packages/ssz/test/perf/epochStatuses.test.ts +++ b/packages/ssz/test/perf/epochStatuses.test.ts @@ -1,7 +1,7 @@ import {itBench} from "@dapplion/benchmark"; -import {CompositeViewDU} from "../../src"; -import {EpochParticipation} from "../lodestarTypes/altair/sszTypes"; -import {fillArray, linspace} from "../utils/misc"; +import {CompositeViewDU} from "../../src/index.js"; +import {EpochParticipation} from "../lodestarTypes/altair/sszTypes.js"; +import {fillArray, linspace} from "../utils/misc.js"; describe("processAttestations() epochStatuses", () => { const len = 250_000; diff --git a/packages/ssz/test/perf/eth2/beaconState.test.ts b/packages/ssz/test/perf/eth2/beaconState.test.ts index 32d8b0313..e9c26616e 100644 --- a/packages/ssz/test/perf/eth2/beaconState.test.ts +++ b/packages/ssz/test/perf/eth2/beaconState.test.ts @@ -1,8 +1,8 @@ import {itBench, setBenchOpts} from "@dapplion/benchmark"; import {HashComputationLevel, executeHashComputations, HashComputationGroup} from "@chainsafe/persistent-merkle-tree"; -import {BeaconState} from "../../lodestarTypes/altair/sszTypes"; -import {BitArray, CompositeViewDU, toHexString} from "../../../src"; -import {preset} from "../../lodestarTypes/params"; +import {BeaconState} from "../../lodestarTypes/altair/sszTypes.js"; +import {BitArray, CompositeViewDU, toHexString} from "../../../src/index.js"; +import {preset} from "../../lodestarTypes/params.js"; const {SLOTS_PER_HISTORICAL_ROOT, EPOCHS_PER_ETH1_VOTING_PERIOD, SLOTS_PER_EPOCH} = preset; const vc = 200_000; diff --git a/packages/ssz/test/perf/eth2/deserialize.test.ts b/packages/ssz/test/perf/eth2/deserialize.test.ts index 4fc396a78..c16019252 100644 --- a/packages/ssz/test/perf/eth2/deserialize.test.ts +++ b/packages/ssz/test/perf/eth2/deserialize.test.ts @@ -1,7 +1,7 @@ import {itBench} from "@dapplion/benchmark"; -import {BeaconState} from "../../lodestarTypes/altair/types"; -import * as sszPhase0 from "../../lodestarTypes/phase0/sszTypes"; -import * as sszAltair from "../../lodestarTypes/altair/sszTypes"; +import {BeaconState} from "../../lodestarTypes/altair/types.js"; +import * as sszPhase0 from "../../lodestarTypes/phase0/sszTypes.js"; +import * as sszAltair from "../../lodestarTypes/altair/sszTypes.js"; import { getAttestation, getOnce, @@ -10,8 +10,8 @@ import { getSyncCommitteeMessage, getSignedContributionAndProof, getSignedBeaconBlockPhase0, -} from "../../utils/generateEth2Objs"; -import {CompositeType, isCompositeType, TreeViewDU, ValueOf} from "../../../src"; +} from "../../utils/generateEth2Objs.js"; +import {CompositeType, isCompositeType, TreeViewDU, ValueOf} from "../../../src/index.js"; describe("Deserialize frequent eth2 objects", () => { itBenchDeserialize(sszPhase0.Attestation, getAttestation(0)); diff --git a/packages/ssz/test/perf/eth2/hashTreeRoot.test.ts b/packages/ssz/test/perf/eth2/hashTreeRoot.test.ts index 1ae6da275..38058bf0e 100644 --- a/packages/ssz/test/perf/eth2/hashTreeRoot.test.ts +++ b/packages/ssz/test/perf/eth2/hashTreeRoot.test.ts @@ -1,7 +1,7 @@ import {itBench} from "@dapplion/benchmark"; import {HashComputationGroup, hasher, uint8ArrayToHashObject} from "@chainsafe/persistent-merkle-tree"; -import * as sszPhase0 from "../../lodestarTypes/phase0/sszTypes"; -import * as sszAltair from "../../lodestarTypes/altair/sszTypes"; +import * as sszPhase0 from "../../lodestarTypes/phase0/sszTypes.js"; +import * as sszAltair from "../../lodestarTypes/altair/sszTypes.js"; import { getAttestation, getOnce, @@ -11,7 +11,7 @@ import { getSignedContributionAndProof, getSignedBeaconBlockPhase0, getValidator, -} from "../../utils/generateEth2Objs"; +} from "../../utils/generateEth2Objs.js"; import { CompositeType, isCompositeType, @@ -21,8 +21,8 @@ import { CompositeView, CompositeViewDU, hash64, -} from "../../../src"; -import {CompositeTypeAny} from "../../../src/type/composite"; +} from "../../../src/index.js"; +import {CompositeTypeAny} from "../../../src/type/composite.js"; import {HashObject} from "@chainsafe/as-sha256"; describe("HashTreeRoot frequent eth2 objects", () => { diff --git a/packages/ssz/test/perf/eth2/validators.test.ts b/packages/ssz/test/perf/eth2/validators.test.ts index 2cd92fafd..7818ffd1d 100644 --- a/packages/ssz/test/perf/eth2/validators.test.ts +++ b/packages/ssz/test/perf/eth2/validators.test.ts @@ -1,7 +1,7 @@ import {itBench} from "@dapplion/benchmark"; -import {Validator} from "../../lodestarTypes/phase0/types"; -import {ValidatorContainer, ValidatorNodeStruct} from "../../lodestarTypes/phase0/sszTypes"; -import {CompositeViewDU} from "../../../src"; +import {Validator} from "../../lodestarTypes/phase0/types.js"; +import {ValidatorContainer, ValidatorNodeStruct} from "../../lodestarTypes/phase0/sszTypes.js"; +import {CompositeViewDU} from "../../../src/index.js"; const validatorStruct: Validator = { pubkey: Buffer.alloc(48, 0xdd), diff --git a/packages/ssz/test/perf/iterate.test.ts b/packages/ssz/test/perf/iterate.test.ts index 92b923e39..218cb1606 100644 --- a/packages/ssz/test/perf/iterate.test.ts +++ b/packages/ssz/test/perf/iterate.test.ts @@ -1,6 +1,6 @@ import {itBench, setBenchOpts} from "@dapplion/benchmark"; -import {ListBasicType, UintNumberType} from "../../src"; -import {Validators} from "../lodestarTypes/phase0/sszTypes"; +import {ListBasicType, UintNumberType} from "../../src/index.js"; +import {Validators} from "../lodestarTypes/phase0/sszTypes.js"; describe("iterate", () => { setBenchOpts({noThreshold: true}); diff --git a/packages/ssz/test/perf/list.test.ts b/packages/ssz/test/perf/list.test.ts index c0a45a35d..af5ac94b1 100644 --- a/packages/ssz/test/perf/list.test.ts +++ b/packages/ssz/test/perf/list.test.ts @@ -1,6 +1,6 @@ import {LeafNode, subtreeFillToContents, Node} from "@chainsafe/persistent-merkle-tree"; import {itBench} from "@dapplion/benchmark"; -import {UintNumberType, ListBasicType} from "../../src"; +import {UintNumberType, ListBasicType} from "../../src/index.js"; describe("list", () => { const numBalances = 250_000; diff --git a/packages/ssz/test/perf/merkleize.test.ts b/packages/ssz/test/perf/merkleize.test.ts index b83a1f5d3..cbcea4481 100644 --- a/packages/ssz/test/perf/merkleize.test.ts +++ b/packages/ssz/test/perf/merkleize.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {bitLength} from "../../src/util/merkleize"; +import {bitLength} from "../../src/util/merkleize.js"; describe("merkleize / bitLength", () => { for (const n of [50, 8000, 250000]) { diff --git a/packages/ssz/test/perf/propertyGet.test.ts b/packages/ssz/test/perf/propertyGet.test.ts index 8c460ff0d..fc6292ef0 100644 --- a/packages/ssz/test/perf/propertyGet.test.ts +++ b/packages/ssz/test/perf/propertyGet.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {UintNumberType, ContainerType, VectorBasicType} from "../../src"; +import {UintNumberType, ContainerType, VectorBasicType} from "../../src/index.js"; describe("SSZ get property", () => { const Gwei = new UintNumberType(8); diff --git a/packages/ssz/test/perf/serdes.test.ts b/packages/ssz/test/perf/serdes.test.ts index 7127171c0..17363f27b 100644 --- a/packages/ssz/test/perf/serdes.test.ts +++ b/packages/ssz/test/perf/serdes.test.ts @@ -13,8 +13,8 @@ import { BitArray, UintNumberType, ByteVectorType, -} from "../../src"; -import {ValidatorContainer, ValidatorNodeStruct} from "../lodestarTypes/phase0/sszTypes"; +} from "../../src/index.js"; +import {ValidatorContainer, ValidatorNodeStruct} from "../lodestarTypes/phase0/sszTypes.js"; describe("SSZ (de)serialize", () => { const uint8 = new UintNumberType(1); diff --git a/packages/ssz/test/perf/stateTransitionOps/processAttestations.test.ts b/packages/ssz/test/perf/stateTransitionOps/processAttestations.test.ts index 9d31259ae..113f1b05a 100644 --- a/packages/ssz/test/perf/stateTransitionOps/processAttestations.test.ts +++ b/packages/ssz/test/perf/stateTransitionOps/processAttestations.test.ts @@ -1,6 +1,6 @@ import {itBench} from "@dapplion/benchmark"; import {MutableVector} from "@chainsafe/persistent-ts"; -import {ListBasicType, UintNumberType, CompositeViewDU} from "../../../src"; +import {ListBasicType, UintNumberType, CompositeViewDU} from "../../../src/index.js"; describe("processAttestations", () => { const vc = 250_000; diff --git a/packages/ssz/test/perf/uint.test.ts b/packages/ssz/test/perf/uint.test.ts index 3cdf6dd95..5c8ec8196 100644 --- a/packages/ssz/test/perf/uint.test.ts +++ b/packages/ssz/test/perf/uint.test.ts @@ -1,5 +1,5 @@ import {itBench} from "@dapplion/benchmark"; -import {ContainerType, UintNumberType, UintBigintType} from "../../src"; +import {ContainerType, UintNumberType, UintBigintType} from "../../src/index.js"; describe("Uint64 types", () => { const ContainerNumber = new ContainerType({ diff --git a/packages/ssz/test/perf/uintFromBytes.test.ts b/packages/ssz/test/perf/uintFromBytes.test.ts index 6a88ea5f2..be1483309 100644 --- a/packages/ssz/test/perf/uintFromBytes.test.ts +++ b/packages/ssz/test/perf/uintFromBytes.test.ts @@ -1,6 +1,6 @@ import {LeafNode} from "@chainsafe/persistent-merkle-tree"; import {itBench} from "@dapplion/benchmark"; -import {UintNumberType, UintBigintType, uintNumberByteLens, uintBigintByteLens} from "../../src/type/uint"; +import {UintNumberType, UintBigintType, uintNumberByteLens, uintBigintByteLens} from "../../src/type/uint.js"; const POW_32 = 2 ** 32; diff --git a/packages/ssz/test/spec/downloadTests.ts b/packages/ssz/test/spec/downloadTests.ts index 9c69fbe2d..df6cdcaa5 100644 --- a/packages/ssz/test/spec/downloadTests.ts +++ b/packages/ssz/test/spec/downloadTests.ts @@ -1,7 +1,7 @@ import fs from "fs"; import path from "path"; import {execSync} from "child_process"; -import {SPEC_TEST_LOCATION, SPEC_TEST_VERSION, SPEC_TEST_REPO_URL} from "../specTestVersioning"; +import {SPEC_TEST_LOCATION, SPEC_TEST_VERSION, SPEC_TEST_REPO_URL} from "../specTestVersioning.js"; /* eslint-disable no-console */ diff --git a/packages/ssz/test/spec/eip-4881/eip4881.test.ts b/packages/ssz/test/spec/eip-4881/eip4881.test.ts index 0cdb96c97..316a724d0 100644 --- a/packages/ssz/test/spec/eip-4881/eip4881.test.ts +++ b/packages/ssz/test/spec/eip-4881/eip4881.test.ts @@ -2,10 +2,10 @@ import fs from "node:fs"; import path from "node:path"; import jsyaml from "js-yaml"; import {expect} from "chai"; -import {ContainerType, ListCompositeType} from "../../../src"; -import {ssz} from "../../lodestarTypes"; -import {DepositDataRootFullList, DepositDataRootPartialList} from "../../lodestarTypes/phase0/sszTypes"; -import {ListCompositeTreeViewDU} from "../../../src/viewDU/listComposite"; +import {ContainerType, ListCompositeType} from "../../../src/index.js"; +import {ssz} from "../../lodestarTypes/index.js"; +import {DepositDataRootFullList, DepositDataRootPartialList} from "../../lodestarTypes/phase0/sszTypes.js"; +import {ListCompositeTreeViewDU} from "../../../src/viewDU/listComposite.js"; const EIP4881TestDataArrayItem = new ContainerType( { diff --git a/packages/ssz/test/spec/generic/index.test.ts b/packages/ssz/test/spec/generic/index.test.ts index 4f7a9dbca..08f8efafd 100644 --- a/packages/ssz/test/spec/generic/index.test.ts +++ b/packages/ssz/test/spec/generic/index.test.ts @@ -1,10 +1,10 @@ import {expect} from "chai"; import path from "path"; import fs from "fs"; -import {SPEC_TEST_LOCATION} from "../../specTestVersioning"; -import {parseSszGenericValidTestcase, parseSszGenericInvalidTestcase} from "../testRunner"; -import {runValidSszTest} from "../runValidTest"; -import {getTestType} from "./types"; +import {SPEC_TEST_LOCATION} from "../../specTestVersioning.js"; +import {parseSszGenericValidTestcase, parseSszGenericInvalidTestcase} from "../testRunner.js"; +import {runValidSszTest} from "../runValidTest.js"; +import {getTestType} from "./types.js"; const rootGenericSszPath = path.join(SPEC_TEST_LOCATION, "tests", "general", "phase0", "ssz_generic"); diff --git a/packages/ssz/test/spec/generic/types.ts b/packages/ssz/test/spec/generic/types.ts index 98f2df169..74e6684e1 100644 --- a/packages/ssz/test/spec/generic/types.ts +++ b/packages/ssz/test/spec/generic/types.ts @@ -9,8 +9,8 @@ import { ListBasicType, VectorBasicType, VectorCompositeType, -} from "../../../src"; -import {UintBigintByteLen} from "../../../src/type/uint"; +} from "../../../src/index.js"; +import {UintBigintByteLen} from "../../../src/type/uint.js"; const bool = new BooleanType(); const byte = new UintNumberType(1); diff --git a/packages/ssz/test/spec/replaceUintTypeWithUintBigintType.ts b/packages/ssz/test/spec/replaceUintTypeWithUintBigintType.ts index c89cf9b6e..2fd098088 100644 --- a/packages/ssz/test/spec/replaceUintTypeWithUintBigintType.ts +++ b/packages/ssz/test/spec/replaceUintTypeWithUintBigintType.ts @@ -14,7 +14,7 @@ import { VectorBasicType, VectorCompositeType, ContainerNodeStructType, -} from "../../src"; +} from "../../src/index.js"; /** * Transform the type to something that is safe to deserialize diff --git a/packages/ssz/test/spec/runValidTest.ts b/packages/ssz/test/spec/runValidTest.ts index 1bac77608..f5a0d7d34 100644 --- a/packages/ssz/test/spec/runValidTest.ts +++ b/packages/ssz/test/spec/runValidTest.ts @@ -1,11 +1,11 @@ import {expect} from "chai"; import {LeafNode, Node} from "@chainsafe/persistent-merkle-tree"; -import {Type} from "../../src/type/abstract"; -import {fromHexString, toHexString} from "../../src/util/byteArray"; -import {CompositeType, isCompositeType} from "../../src/type/composite"; -import {isBasicType} from "../../src/type/basic"; -import {wrapErr} from "../utils/error"; -import {TreeViewDU} from "../../src"; +import {Type} from "../../src/type/abstract.js"; +import {fromHexString, toHexString} from "../../src/util/byteArray.js"; +import {CompositeType, isCompositeType} from "../../src/type/composite.js"; +import {isBasicType} from "../../src/type/basic.js"; +import {wrapErr} from "../utils/error.js"; +import {TreeViewDU} from "../../src/index.js"; type ValidTestCaseData = { root: string; diff --git a/packages/ssz/test/spec/ssz_static.test.ts b/packages/ssz/test/spec/ssz_static.test.ts index b67a24efb..95349075a 100644 --- a/packages/ssz/test/spec/ssz_static.test.ts +++ b/packages/ssz/test/spec/ssz_static.test.ts @@ -1,5 +1,5 @@ -import {ForkName} from "../utils/fork"; -import {sszStatic} from "./ssz_static"; +import {ForkName} from "../utils/fork.js"; +import {sszStatic} from "./ssz_static.js"; if (process.env.LODESTAR_FORK) { sszStatic(process.env.LODESTAR_FORK as ForkName); diff --git a/packages/ssz/test/spec/ssz_static.ts b/packages/ssz/test/spec/ssz_static.ts index cffe0ad86..066d36883 100644 --- a/packages/ssz/test/spec/ssz_static.ts +++ b/packages/ssz/test/spec/ssz_static.ts @@ -1,14 +1,14 @@ import fs from "fs"; import path from "path"; -import {isCompositeType, Type} from "../../src"; -import {ssz} from "../lodestarTypes"; -import {SPEC_TEST_LOCATION} from "../specTestVersioning"; -import {replaceUintTypeWithUintBigintType} from "./replaceUintTypeWithUintBigintType"; -import {parseSszStaticTestcase} from "./testRunner"; -import {runValidSszTest} from "./runValidTest"; -import {ForkName} from "../utils/fork"; -import {ACTIVE_PRESET} from "../lodestarTypes/params"; -import {runProofTestOnAllJsonPaths} from "../unit/byType/runTypeProofTest"; +import {isCompositeType, Type} from "../../src/index.js"; +import {ssz} from "../lodestarTypes/index.js"; +import {SPEC_TEST_LOCATION} from "../specTestVersioning.js"; +import {replaceUintTypeWithUintBigintType} from "./replaceUintTypeWithUintBigintType.js"; +import {parseSszStaticTestcase} from "./testRunner.js"; +import {runValidSszTest} from "./runValidTest.js"; +import {ForkName} from "../utils/fork.js"; +import {ACTIVE_PRESET} from "../lodestarTypes/params.js"; +import {runProofTestOnAllJsonPaths} from "../unit/byType/runTypeProofTest.js"; // ssz_static // | Attestation diff --git a/packages/ssz/test/spec/testRunner.ts b/packages/ssz/test/spec/testRunner.ts index 1310fe88e..7154014f1 100644 --- a/packages/ssz/test/spec/testRunner.ts +++ b/packages/ssz/test/spec/testRunner.ts @@ -2,7 +2,7 @@ import path from "path"; import fs from "fs"; import {uncompress} from "snappyjs"; import jsyaml from "js-yaml"; -import {schema} from "./sszYamlSchema"; +import {schema} from "./sszYamlSchema.js"; /* eslint-disable @typescript-eslint/explicit-module-boundary-types, diff --git a/packages/ssz/test/unit/byType/bitArray/tree.test.ts b/packages/ssz/test/unit/byType/bitArray/tree.test.ts index 456243c5d..ace3c9dda 100644 --- a/packages/ssz/test/unit/byType/bitArray/tree.test.ts +++ b/packages/ssz/test/unit/byType/bitArray/tree.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {BitVectorType, BitListType, BitArray} from "../../../../src"; -import {runViewTestMutation} from "../runViewTestMutation"; +import {BitVectorType, BitListType, BitArray} from "../../../../src/index.js"; +import {runViewTestMutation} from "../runViewTestMutation.js"; for (const type of [new BitVectorType(4), new BitListType(4)]) { runViewTestMutation({ diff --git a/packages/ssz/test/unit/byType/bitList/invalid.test.ts b/packages/ssz/test/unit/byType/bitList/invalid.test.ts index 25fbf2eb7..be07a7160 100644 --- a/packages/ssz/test/unit/byType/bitList/invalid.test.ts +++ b/packages/ssz/test/unit/byType/bitList/invalid.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {BitListType} from "../../../../src"; -import {runTypeTestInvalid} from "../runTypeTestInvalid"; +import {BitListType} from "../../../../src/index.js"; +import {runTypeTestInvalid} from "../runTypeTestInvalid.js"; runTypeTestInvalid({ type: new BitListType(8 * 8), diff --git a/packages/ssz/test/unit/byType/bitList/valid.test.ts b/packages/ssz/test/unit/byType/bitList/valid.test.ts index 5ab83295c..630b5e1e7 100644 --- a/packages/ssz/test/unit/byType/bitList/valid.test.ts +++ b/packages/ssz/test/unit/byType/bitList/valid.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {BitListType, BitArray, toHexString} from "../../../../src"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {BitListType, BitArray, toHexString} from "../../../../src/index.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; runTypeTestValid({ type: new BitListType(2048), diff --git a/packages/ssz/test/unit/byType/bitVector/invalid.test.ts b/packages/ssz/test/unit/byType/bitVector/invalid.test.ts index df52a1721..d140b85c9 100644 --- a/packages/ssz/test/unit/byType/bitVector/invalid.test.ts +++ b/packages/ssz/test/unit/byType/bitVector/invalid.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {BitVectorType} from "../../../../src"; -import {runTypeTestInvalid} from "../runTypeTestInvalid"; +import {BitVectorType} from "../../../../src/index.js"; +import {runTypeTestInvalid} from "../runTypeTestInvalid.js"; runTypeTestInvalid({ type: new BitVectorType(8 * 8), diff --git a/packages/ssz/test/unit/byType/bitVector/tree.test.ts b/packages/ssz/test/unit/byType/bitVector/tree.test.ts index 04f2ee142..6adeef9c0 100644 --- a/packages/ssz/test/unit/byType/bitVector/tree.test.ts +++ b/packages/ssz/test/unit/byType/bitVector/tree.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {BitVectorType, BitArray} from "../../../../src"; -import {runViewTestMutation} from "../runViewTestMutation"; +import {BitVectorType, BitArray} from "../../../../src/index.js"; +import {runViewTestMutation} from "../runViewTestMutation.js"; runViewTestMutation({ type: new BitVectorType(4), diff --git a/packages/ssz/test/unit/byType/bitVector/valid.test.ts b/packages/ssz/test/unit/byType/bitVector/valid.test.ts index 375300a8a..0c39da479 100644 --- a/packages/ssz/test/unit/byType/bitVector/valid.test.ts +++ b/packages/ssz/test/unit/byType/bitVector/valid.test.ts @@ -1,5 +1,5 @@ -import {BitVectorType, BitArray} from "../../../../src"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {BitVectorType, BitArray} from "../../../../src/index.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; runTypeTestValid({ type: new BitVectorType(128), diff --git a/packages/ssz/test/unit/byType/boolean/invalid.test.ts b/packages/ssz/test/unit/byType/boolean/invalid.test.ts index b4a225113..fda73e5c1 100644 --- a/packages/ssz/test/unit/byType/boolean/invalid.test.ts +++ b/packages/ssz/test/unit/byType/boolean/invalid.test.ts @@ -1,5 +1,5 @@ -import {BooleanType} from "../../../../src"; -import {runTypeTestInvalid} from "../runTypeTestInvalid"; +import {BooleanType} from "../../../../src/index.js"; +import {runTypeTestInvalid} from "../runTypeTestInvalid.js"; runTypeTestInvalid({ type: new BooleanType(), diff --git a/packages/ssz/test/unit/byType/boolean/tree.test.ts b/packages/ssz/test/unit/byType/boolean/tree.test.ts index fe4faa128..6e329a2d7 100644 --- a/packages/ssz/test/unit/byType/boolean/tree.test.ts +++ b/packages/ssz/test/unit/byType/boolean/tree.test.ts @@ -1,7 +1,7 @@ import {LeafNode} from "@chainsafe/persistent-merkle-tree"; import {expect} from "chai"; -import {toHexString} from "../../../../src/util/byteArray"; -import {BooleanType} from "../../../../src"; +import {toHexString} from "../../../../src/util/byteArray.js"; +import {BooleanType} from "../../../../src/index.js"; describe("BooleanType / tree", () => { const booleanType = new BooleanType(); diff --git a/packages/ssz/test/unit/byType/boolean/valid.test.ts b/packages/ssz/test/unit/byType/boolean/valid.test.ts index 3de3873b6..01f188c1f 100644 --- a/packages/ssz/test/unit/byType/boolean/valid.test.ts +++ b/packages/ssz/test/unit/byType/boolean/valid.test.ts @@ -1,5 +1,5 @@ -import {BooleanType} from "../../../../src"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {BooleanType} from "../../../../src/index.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; runTypeTestValid({ type: new BooleanType(), diff --git a/packages/ssz/test/unit/byType/byteList/invalid.test.ts b/packages/ssz/test/unit/byType/byteList/invalid.test.ts index a312f32d9..33699d2c6 100644 --- a/packages/ssz/test/unit/byType/byteList/invalid.test.ts +++ b/packages/ssz/test/unit/byType/byteList/invalid.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {ByteListType} from "../../../../src"; -import {runTypeTestInvalid} from "../runTypeTestInvalid"; +import {ByteListType} from "../../../../src/index.js"; +import {runTypeTestInvalid} from "../runTypeTestInvalid.js"; runTypeTestInvalid({ type: new ByteListType(8), diff --git a/packages/ssz/test/unit/byType/byteList/valid.test.ts b/packages/ssz/test/unit/byType/byteList/valid.test.ts index 73fad827a..89cbf89e6 100644 --- a/packages/ssz/test/unit/byType/byteList/valid.test.ts +++ b/packages/ssz/test/unit/byType/byteList/valid.test.ts @@ -1,5 +1,5 @@ -import {ListBasicType, ByteListType, fromHexString, UintNumberType} from "../../../../src"; -import {runTypeTestValid, TypeTestValid} from "../runTypeTestValid"; +import {ListBasicType, ByteListType, fromHexString, UintNumberType} from "../../../../src/index.js"; +import {runTypeTestValid, TypeTestValid} from "../runTypeTestValid.js"; runTypeTestValid({ type: new ByteListType(256), diff --git a/packages/ssz/test/unit/byType/byteVector/invalid.test.ts b/packages/ssz/test/unit/byType/byteVector/invalid.test.ts index 2dfbd9657..faee359e0 100644 --- a/packages/ssz/test/unit/byType/byteVector/invalid.test.ts +++ b/packages/ssz/test/unit/byType/byteVector/invalid.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {ByteVectorType} from "../../../../src"; -import {runTypeTestInvalid} from "../runTypeTestInvalid"; +import {ByteVectorType} from "../../../../src/index.js"; +import {runTypeTestInvalid} from "../runTypeTestInvalid.js"; runTypeTestInvalid({ type: new ByteVectorType(8), diff --git a/packages/ssz/test/unit/byType/byteVector/tree.test.ts b/packages/ssz/test/unit/byType/byteVector/tree.test.ts index ba2d37a6d..fa931dacf 100644 --- a/packages/ssz/test/unit/byType/byteVector/tree.test.ts +++ b/packages/ssz/test/unit/byType/byteVector/tree.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {ByteVectorType, ContainerType} from "../../../../src"; +import {ByteVectorType, ContainerType} from "../../../../src/index.js"; describe("ByteVectorType proofs", () => { const rootType = new ByteVectorType(32); diff --git a/packages/ssz/test/unit/byType/byteVector/valid.test.ts b/packages/ssz/test/unit/byType/byteVector/valid.test.ts index 27fcfa97f..0f987fea8 100644 --- a/packages/ssz/test/unit/byType/byteVector/valid.test.ts +++ b/packages/ssz/test/unit/byType/byteVector/valid.test.ts @@ -1,5 +1,5 @@ -import {ByteVectorType} from "../../../../src"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {ByteVectorType} from "../../../../src/index.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; runTypeTestValid({ type: new ByteVectorType(4), diff --git a/packages/ssz/test/unit/byType/composite/tree.test.ts b/packages/ssz/test/unit/byType/composite/tree.test.ts index a0b9b3337..c69203d58 100644 --- a/packages/ssz/test/unit/byType/composite/tree.test.ts +++ b/packages/ssz/test/unit/byType/composite/tree.test.ts @@ -9,9 +9,9 @@ import { NoneType, BitVectorType, BitArray, -} from "../../../../src"; -import {uintNumberByteLens, uintBigintByteLens} from "../../../../src/type/uint"; -import {runViewTestCompositeSwap} from "../runViewTestCompositeSwap"; +} from "../../../../src/index.js"; +import {uintNumberByteLens, uintBigintByteLens} from "../../../../src/type/uint.js"; +import {runViewTestCompositeSwap} from "../runViewTestCompositeSwap.js"; // Swap properties tests. Because swaping uses the same property names you can write many more tests // just by declaring the property type and two values: diff --git a/packages/ssz/test/unit/byType/container/invalid.test.ts b/packages/ssz/test/unit/byType/container/invalid.test.ts index 642348983..0742ec2f2 100644 --- a/packages/ssz/test/unit/byType/container/invalid.test.ts +++ b/packages/ssz/test/unit/byType/container/invalid.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; -import {ContainerNodeStructType, ContainerType, ListBasicType, UintNumberType} from "../../../../src"; -import {byteType, uint16NumType} from "../../../utils/primitiveTypes"; -import {runTypeTestInvalid} from "../runTypeTestInvalid"; +import {ContainerNodeStructType, ContainerType, ListBasicType, UintNumberType} from "../../../../src/index.js"; +import {byteType, uint16NumType} from "../../../utils/primitiveTypes.js"; +import {runTypeTestInvalid} from "../runTypeTestInvalid.js"; runTypeTestInvalid({ type: new ContainerType({a: uint16NumType}), diff --git a/packages/ssz/test/unit/byType/container/tree.test.ts b/packages/ssz/test/unit/byType/container/tree.test.ts index 83fad27a0..b72975a47 100644 --- a/packages/ssz/test/unit/byType/container/tree.test.ts +++ b/packages/ssz/test/unit/byType/container/tree.test.ts @@ -19,10 +19,10 @@ import { ValueOf, VectorBasicType, VectorCompositeType, -} from "../../../../src"; -import {uint64NumInfType, uint64NumType} from "../../../utils/primitiveTypes"; -import {runViewTestMutation} from "../runViewTestMutation"; -import {upgradeToNewType} from "../../../../src/util/upgrade"; +} from "../../../../src/index.js"; +import {uint64NumInfType, uint64NumType} from "../../../utils/primitiveTypes.js"; +import {runViewTestMutation} from "../runViewTestMutation.js"; +import {upgradeToNewType} from "../../../../src/util/upgrade.js"; // Test both ContainerType, ContainerNodeStructType only if // - All fields are immutable diff --git a/packages/ssz/test/unit/byType/container/valid.test.ts b/packages/ssz/test/unit/byType/container/valid.test.ts index 6aed81872..8436a8d2d 100644 --- a/packages/ssz/test/unit/byType/container/valid.test.ts +++ b/packages/ssz/test/unit/byType/container/valid.test.ts @@ -1,9 +1,9 @@ -import {ContainerType, ContainerNodeStructType, ListBasicType, ByteVectorType} from "../../../../src"; -import {ssz} from "../../../lodestarTypes"; -import {SignedContributionAndProof} from "../../../lodestarTypes/altair/sszTypes"; -import {replaceUintTypeWithUintBigintType} from "../../../spec/replaceUintTypeWithUintBigintType"; -import {uint64NumInfType} from "../../../utils/primitiveTypes"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {ContainerType, ContainerNodeStructType, ListBasicType, ByteVectorType} from "../../../../src/index.js"; +import {ssz} from "../../../lodestarTypes/index.js"; +import {SignedContributionAndProof} from "../../../lodestarTypes/altair/sszTypes.js"; +import {replaceUintTypeWithUintBigintType} from "../../../spec/replaceUintTypeWithUintBigintType.js"; +import {uint64NumInfType} from "../../../utils/primitiveTypes.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; for (const ContainerTypeTest of [ContainerType, ContainerNodeStructType]) { runTypeTestValid({ diff --git a/packages/ssz/test/unit/byType/listBasic/invalid.test.ts b/packages/ssz/test/unit/byType/listBasic/invalid.test.ts index 7454f7793..97ffa67a8 100644 --- a/packages/ssz/test/unit/byType/listBasic/invalid.test.ts +++ b/packages/ssz/test/unit/byType/listBasic/invalid.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; -import {ListBasicType} from "../../../../src"; -import {byteType} from "../../../utils/primitiveTypes"; -import {runTypeTestInvalid} from "../runTypeTestInvalid"; +import {ListBasicType} from "../../../../src/index.js"; +import {byteType} from "../../../utils/primitiveTypes.js"; +import {runTypeTestInvalid} from "../runTypeTestInvalid.js"; runTypeTestInvalid({ type: new ListBasicType(byteType, 2), diff --git a/packages/ssz/test/unit/byType/listBasic/misc.test.ts b/packages/ssz/test/unit/byType/listBasic/misc.test.ts index 834d31ce8..2520f4180 100644 --- a/packages/ssz/test/unit/byType/listBasic/misc.test.ts +++ b/packages/ssz/test/unit/byType/listBasic/misc.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {ListBasicType, UintNumberType} from "../../../../src"; +import {ListBasicType, UintNumberType} from "../../../../src/index.js"; describe("To hit 100% coverage", () => { const listBasic = new ListBasicType(new UintNumberType(1), 4); diff --git a/packages/ssz/test/unit/byType/listBasic/mutation.test.ts b/packages/ssz/test/unit/byType/listBasic/mutation.test.ts index 09fc38431..269ceaaec 100644 --- a/packages/ssz/test/unit/byType/listBasic/mutation.test.ts +++ b/packages/ssz/test/unit/byType/listBasic/mutation.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {ListBasicType, UintNumberType} from "../../../../src"; +import {ListBasicType, UintNumberType} from "../../../../src/index.js"; describe("BasicList", () => { it("TreeView edit mutate and transfer", () => { diff --git a/packages/ssz/test/unit/byType/listBasic/tree.test.ts b/packages/ssz/test/unit/byType/listBasic/tree.test.ts index 22b5f50d6..08f8b54d4 100644 --- a/packages/ssz/test/unit/byType/listBasic/tree.test.ts +++ b/packages/ssz/test/unit/byType/listBasic/tree.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; -import {ListBasicType, toHexString, UintNumberType} from "../../../../src"; -import {runViewTestMutation, TreeMutation} from "../runViewTestMutation"; -import {ListUintNum64Type} from "../../../../src/type/listUintNum64"; +import {ListBasicType, toHexString, UintNumberType} from "../../../../src/index.js"; +import {runViewTestMutation, TreeMutation} from "../runViewTestMutation.js"; +import {ListUintNum64Type} from "../../../../src/type/listUintNum64.js"; const limit = 100; const uint64NumInf = new UintNumberType(8, {clipInfinity: true}); diff --git a/packages/ssz/test/unit/byType/listBasic/valid.test.ts b/packages/ssz/test/unit/byType/listBasic/valid.test.ts index 3be4a786e..20c4b7580 100644 --- a/packages/ssz/test/unit/byType/listBasic/valid.test.ts +++ b/packages/ssz/test/unit/byType/listBasic/valid.test.ts @@ -1,5 +1,5 @@ -import {ListBasicType, UintNumberType} from "../../../../src"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {ListBasicType, UintNumberType} from "../../../../src/index.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; runTypeTestValid({ type: new ListBasicType(new UintNumberType(1), 128), diff --git a/packages/ssz/test/unit/byType/listComposite/invalid.test.ts b/packages/ssz/test/unit/byType/listComposite/invalid.test.ts index 9630d6bca..37acceb96 100644 --- a/packages/ssz/test/unit/byType/listComposite/invalid.test.ts +++ b/packages/ssz/test/unit/byType/listComposite/invalid.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {ListCompositeType, UintNumberType, ContainerType, ListBasicType} from "../../../../src"; -import {runTypeTestInvalid} from "../runTypeTestInvalid"; +import {ListCompositeType, UintNumberType, ContainerType, ListBasicType} from "../../../../src/index.js"; +import {runTypeTestInvalid} from "../runTypeTestInvalid.js"; const uint16 = new UintNumberType(2); diff --git a/packages/ssz/test/unit/byType/listComposite/tree.test.ts b/packages/ssz/test/unit/byType/listComposite/tree.test.ts index 95b39746c..90ad65043 100644 --- a/packages/ssz/test/unit/byType/listComposite/tree.test.ts +++ b/packages/ssz/test/unit/byType/listComposite/tree.test.ts @@ -7,11 +7,11 @@ import { toHexString, UintNumberType, ValueOf, -} from "../../../../src"; -import {ArrayCompositeTreeViewDU} from "../../../../src/viewDU/arrayComposite"; -import {ssz} from "../../../lodestarTypes/primitive"; -import {runViewTestMutation} from "../runViewTestMutation"; -import {ListCompositeTreeViewDU} from "../../../../src/viewDU/listComposite"; +} from "../../../../src/index.js"; +import {ArrayCompositeTreeViewDU} from "../../../../src/viewDU/arrayComposite.js"; +import {ssz} from "../../../lodestarTypes/primitive/index.js"; +import {runViewTestMutation} from "../runViewTestMutation.js"; +import {ListCompositeTreeViewDU} from "../../../../src/viewDU/listComposite.js"; const uint64NumInfType = new UintNumberType(8, {clipInfinity: true}); const containerUintsType = new ContainerType( diff --git a/packages/ssz/test/unit/byType/listComposite/valid.test.ts b/packages/ssz/test/unit/byType/listComposite/valid.test.ts index fa466f09e..1e004ac95 100644 --- a/packages/ssz/test/unit/byType/listComposite/valid.test.ts +++ b/packages/ssz/test/unit/byType/listComposite/valid.test.ts @@ -1,5 +1,5 @@ -import {ContainerType, ListCompositeType, UintNumberType, ByteVectorType, ListBasicType} from "../../../../src"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {ContainerType, ListCompositeType, UintNumberType, ByteVectorType, ListBasicType} from "../../../../src/index.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; const uint64Type = new UintNumberType(8); diff --git a/packages/ssz/test/unit/byType/none/invalid.test.ts b/packages/ssz/test/unit/byType/none/invalid.test.ts index c8367659d..4b802bdaf 100644 --- a/packages/ssz/test/unit/byType/none/invalid.test.ts +++ b/packages/ssz/test/unit/byType/none/invalid.test.ts @@ -1,5 +1,5 @@ -import {NoneType} from "../../../../src/type/none"; -import {runTypeTestInvalid} from "../runTypeTestInvalid"; +import {NoneType} from "../../../../src/type/none.js"; +import {runTypeTestInvalid} from "../runTypeTestInvalid.js"; runTypeTestInvalid({ type: new NoneType(), diff --git a/packages/ssz/test/unit/byType/none/misc.test.ts b/packages/ssz/test/unit/byType/none/misc.test.ts index 3fd45b76b..b98e7bb1a 100644 --- a/packages/ssz/test/unit/byType/none/misc.test.ts +++ b/packages/ssz/test/unit/byType/none/misc.test.ts @@ -1,6 +1,6 @@ import {LeafNode} from "@chainsafe/persistent-merkle-tree"; import {expect} from "chai"; -import {NoneType, toHexString} from "../../../../src"; +import {NoneType, toHexString} from "../../../../src/index.js"; describe("None type", () => { const noneType = new NoneType(); diff --git a/packages/ssz/test/unit/byType/none/valid.test.ts b/packages/ssz/test/unit/byType/none/valid.test.ts index aeb486520..612039e63 100644 --- a/packages/ssz/test/unit/byType/none/valid.test.ts +++ b/packages/ssz/test/unit/byType/none/valid.test.ts @@ -1,5 +1,5 @@ -import {NoneType} from "../../../../src/type/none"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {NoneType} from "../../../../src/type/none.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; runTypeTestValid({ type: new NoneType(), diff --git a/packages/ssz/test/unit/byType/optional/invalid.test.ts b/packages/ssz/test/unit/byType/optional/invalid.test.ts index f6c507960..583788045 100644 --- a/packages/ssz/test/unit/byType/optional/invalid.test.ts +++ b/packages/ssz/test/unit/byType/optional/invalid.test.ts @@ -1,5 +1,5 @@ -import {UintNumberType, OptionalType} from "../../../../src"; -import {runTypeTestInvalid} from "../runTypeTestInvalid"; +import {UintNumberType, OptionalType} from "../../../../src/index.js"; +import {runTypeTestInvalid} from "../runTypeTestInvalid.js"; const byteType = new UintNumberType(1); diff --git a/packages/ssz/test/unit/byType/optional/tree.test.ts b/packages/ssz/test/unit/byType/optional/tree.test.ts index 5b69d17ac..85be0f3f2 100644 --- a/packages/ssz/test/unit/byType/optional/tree.test.ts +++ b/packages/ssz/test/unit/byType/optional/tree.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {OptionalType, ContainerType, UintNumberType, ValueOf, toHexString} from "../../../../src"; +import {OptionalType, ContainerType, UintNumberType, ValueOf, toHexString} from "../../../../src/index.js"; const byteType = new UintNumberType(1); const SimpleObject = new ContainerType({ diff --git a/packages/ssz/test/unit/byType/optional/valid.test.ts b/packages/ssz/test/unit/byType/optional/valid.test.ts index 698a6e846..c35c91f7b 100644 --- a/packages/ssz/test/unit/byType/optional/valid.test.ts +++ b/packages/ssz/test/unit/byType/optional/valid.test.ts @@ -1,5 +1,5 @@ -import {OptionalType, UintNumberType, ListBasicType, ContainerType, ListCompositeType} from "../../../../src"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {OptionalType, UintNumberType, ListBasicType, ContainerType, ListCompositeType} from "../../../../src/index.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; const number8Type = new UintNumberType(1); const SimpleObject = new ContainerType({ diff --git a/packages/ssz/test/unit/byType/partialListComposite/tree.test.ts b/packages/ssz/test/unit/byType/partialListComposite/tree.test.ts index eea5d9aa3..303ee1700 100644 --- a/packages/ssz/test/unit/byType/partialListComposite/tree.test.ts +++ b/packages/ssz/test/unit/byType/partialListComposite/tree.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {ContainerType, ListCompositeType, UintNumberType} from "../../../../src"; -import {PartialListCompositeType} from "../../../../src/type/partialListComposite"; +import {ContainerType, ListCompositeType, UintNumberType} from "../../../../src/index.js"; +import {PartialListCompositeType} from "../../../../src/type/partialListComposite.js"; const uint64NumInfType = new UintNumberType(8, {clipInfinity: true}); const containerUintsType = new ContainerType( diff --git a/packages/ssz/test/unit/byType/profile/tree.test.ts b/packages/ssz/test/unit/byType/profile/tree.test.ts index a29662afe..9f7770def 100644 --- a/packages/ssz/test/unit/byType/profile/tree.test.ts +++ b/packages/ssz/test/unit/byType/profile/tree.test.ts @@ -20,9 +20,9 @@ import { ValueOf, VectorBasicType, VectorCompositeType, -} from "../../../../src"; -import {uint64NumInfType, uint64NumType} from "../../../utils/primitiveTypes"; -import {runViewTestMutation} from "../runViewTestMutation"; +} from "../../../../src/index.js"; +import {uint64NumInfType, uint64NumType} from "../../../utils/primitiveTypes.js"; +import {runViewTestMutation} from "../runViewTestMutation.js"; // Test both ContainerType, ContainerNodeStructType only if // - All fields are immutable diff --git a/packages/ssz/test/unit/byType/profile/valid.test.ts b/packages/ssz/test/unit/byType/profile/valid.test.ts index 9a1f67e2a..c7209b96b 100644 --- a/packages/ssz/test/unit/byType/profile/valid.test.ts +++ b/packages/ssz/test/unit/byType/profile/valid.test.ts @@ -1,5 +1,5 @@ -import {BitArray, ProfileType, UintNumberType} from "../../../../src"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {BitArray, ProfileType, UintNumberType} from "../../../../src/index.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; // taken from eip spec tests diff --git a/packages/ssz/test/unit/byType/runTypeProofTest.ts b/packages/ssz/test/unit/byType/runTypeProofTest.ts index e0b36e2a0..dd2040c97 100644 --- a/packages/ssz/test/unit/byType/runTypeProofTest.ts +++ b/packages/ssz/test/unit/byType/runTypeProofTest.ts @@ -9,11 +9,11 @@ import { ProfileType, StableContainerType, Type, -} from "../../../src"; -import {CompositeTypeAny, isCompositeType} from "../../../src/type/composite"; -import {ArrayBasicTreeView} from "../../../src/view/arrayBasic"; -import {RootHex} from "../../lodestarTypes"; -import {wrapErr} from "../../utils/error"; +} from "../../../src/index.js"; +import {CompositeTypeAny, isCompositeType} from "../../../src/type/composite.js"; +import {ArrayBasicTreeView} from "../../../src/view/arrayBasic.js"; +import {RootHex} from "../../lodestarTypes/index.js"; +import {wrapErr} from "../../utils/error.js"; export function runProofTestOnAllJsonPaths({ type, diff --git a/packages/ssz/test/unit/byType/runTypeTestInvalid.ts b/packages/ssz/test/unit/byType/runTypeTestInvalid.ts index b68d40c18..2dcc6325b 100644 --- a/packages/ssz/test/unit/byType/runTypeTestInvalid.ts +++ b/packages/ssz/test/unit/byType/runTypeTestInvalid.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {CompositeType, fromHexString, Type} from "../../../src"; +import {CompositeType, fromHexString, Type} from "../../../src/index.js"; /* eslint-disable @typescript-eslint/no-unsafe-assignment */ diff --git a/packages/ssz/test/unit/byType/runTypeTestValid.ts b/packages/ssz/test/unit/byType/runTypeTestValid.ts index 3775c3cac..333469e46 100644 --- a/packages/ssz/test/unit/byType/runTypeTestValid.ts +++ b/packages/ssz/test/unit/byType/runTypeTestValid.ts @@ -1,9 +1,9 @@ import {expect} from "chai"; -import {toHexString, TreeViewDU, UnionType} from "../../../src"; -import {Type} from "../../../src/type/abstract"; -import {isCompositeType} from "../../../src/type/composite"; -import {runValidSszTest, toJsonOrString} from "../../spec/runValidTest"; -import {runProofTestOnAllJsonPaths} from "./runTypeProofTest"; +import {toHexString, TreeViewDU, UnionType} from "../../../src/index.js"; +import {Type} from "../../../src/type/abstract.js"; +import {isCompositeType} from "../../../src/type/composite.js"; +import {runValidSszTest, toJsonOrString} from "../../spec/runValidTest.js"; +import {runProofTestOnAllJsonPaths} from "./runTypeProofTest.js"; /* eslint-disable @typescript-eslint/no-unsafe-assignment */ diff --git a/packages/ssz/test/unit/byType/runViewTestCompositeSwap.ts b/packages/ssz/test/unit/byType/runViewTestCompositeSwap.ts index 72d3ad87b..172baa3d9 100644 --- a/packages/ssz/test/unit/byType/runViewTestCompositeSwap.ts +++ b/packages/ssz/test/unit/byType/runViewTestCompositeSwap.ts @@ -1,6 +1,6 @@ -import {Type, ValueOf, TreeView, BasicType} from "../../../src"; -import {ContainerType, ListBasicType, ListCompositeType, VectorBasicType, VectorCompositeType} from "../../../src"; -import {runViewTestMutation} from "./runViewTestMutation"; +import {Type, ValueOf, TreeView, BasicType} from "../../../src/index.js"; +import {ContainerType, ListBasicType, ListCompositeType, VectorBasicType, VectorCompositeType} from "../../../src/index.js"; +import {runViewTestMutation} from "./runViewTestMutation.js"; const runViewTestCompositeSwapFn = function runViewTestCompositeSwap>( propertyType: T, diff --git a/packages/ssz/test/unit/byType/runViewTestMutation.ts b/packages/ssz/test/unit/byType/runViewTestMutation.ts index 85298774d..be6a5441d 100644 --- a/packages/ssz/test/unit/byType/runViewTestMutation.ts +++ b/packages/ssz/test/unit/byType/runViewTestMutation.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {toHexString} from "../../../src/util/byteArray"; -import {CompositeType, ValueOf, TreeViewDU, CompositeViewDU} from "../../../src"; +import {toHexString} from "../../../src/util/byteArray.js"; +import {CompositeType, ValueOf, TreeViewDU, CompositeViewDU} from "../../../src/index.js"; export type TreeMutation> = { id: string; diff --git a/packages/ssz/test/unit/byType/stableContainer/tree.test.ts b/packages/ssz/test/unit/byType/stableContainer/tree.test.ts index 36d40dfe9..f0bcfd63c 100644 --- a/packages/ssz/test/unit/byType/stableContainer/tree.test.ts +++ b/packages/ssz/test/unit/byType/stableContainer/tree.test.ts @@ -18,9 +18,9 @@ import { ValueOf, VectorBasicType, VectorCompositeType, -} from "../../../../src"; -import {uint64NumInfType, uint64NumType} from "../../../utils/primitiveTypes"; -import {runViewTestMutation} from "../runViewTestMutation"; +} from "../../../../src/index.js"; +import {uint64NumInfType, uint64NumType} from "../../../utils/primitiveTypes.js"; +import {runViewTestMutation} from "../runViewTestMutation.js"; import {getNodesAtDepth, Tree, zeroHash} from "@chainsafe/persistent-merkle-tree"; // Test both ContainerType, ContainerNodeStructType only if diff --git a/packages/ssz/test/unit/byType/stableContainer/valid.test.ts b/packages/ssz/test/unit/byType/stableContainer/valid.test.ts index 90bfe6885..bb585d2db 100644 --- a/packages/ssz/test/unit/byType/stableContainer/valid.test.ts +++ b/packages/ssz/test/unit/byType/stableContainer/valid.test.ts @@ -1,5 +1,5 @@ -import {ListBasicType, OptionalType, StableContainerType, UintNumberType} from "../../../../src"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {ListBasicType, OptionalType, StableContainerType, UintNumberType} from "../../../../src/index.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; // taken from eip spec tests diff --git a/packages/ssz/test/unit/byType/uint/invalid.test.ts b/packages/ssz/test/unit/byType/uint/invalid.test.ts index c37a0f1d1..efc38323f 100644 --- a/packages/ssz/test/unit/byType/uint/invalid.test.ts +++ b/packages/ssz/test/unit/byType/uint/invalid.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; -import {UintNumberType, UintBigintType} from "../../../../src"; -import {UintNumberByteLen, uintNumberByteLens, uintBigintByteLens} from "../../../../src/type/uint"; -import {runTypeTestInvalid, InvalidValue} from "../runTypeTestInvalid"; +import {UintNumberType, UintBigintType} from "../../../../src/index.js"; +import {UintNumberByteLen, uintNumberByteLens, uintBigintByteLens} from "../../../../src/type/uint.js"; +import {runTypeTestInvalid, InvalidValue} from "../runTypeTestInvalid.js"; for (const byteLen of uintNumberByteLens) { runTypeTestInvalid({ diff --git a/packages/ssz/test/unit/byType/uint/tree.test.ts b/packages/ssz/test/unit/byType/uint/tree.test.ts index 19fe63f7e..8db0904a6 100644 --- a/packages/ssz/test/unit/byType/uint/tree.test.ts +++ b/packages/ssz/test/unit/byType/uint/tree.test.ts @@ -1,7 +1,7 @@ import {LeafNode} from "@chainsafe/persistent-merkle-tree"; import {expect} from "chai"; -import {toHexString, fromHexString} from "../../../../src/util/byteArray"; -import {byteType, uint64NumInfType} from "../../../utils/primitiveTypes"; +import {toHexString, fromHexString} from "../../../../src/util/byteArray.js"; +import {byteType, uint64NumInfType} from "../../../utils/primitiveTypes.js"; describe("UintNumberType / tree", () => { it("Single value", () => { diff --git a/packages/ssz/test/unit/byType/uint/valid.test.ts b/packages/ssz/test/unit/byType/uint/valid.test.ts index 518f7c631..e3e2452a5 100644 --- a/packages/ssz/test/unit/byType/uint/valid.test.ts +++ b/packages/ssz/test/unit/byType/uint/valid.test.ts @@ -1,5 +1,5 @@ -import {UintBigintType, UintNumberType} from "../../../../src/type/uint"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {UintBigintType, UintNumberType} from "../../../../src/type/uint.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; runTypeTestValid({ type: new UintNumberType(1), diff --git a/packages/ssz/test/unit/byType/union/invalid.test.ts b/packages/ssz/test/unit/byType/union/invalid.test.ts index acad0d784..d2df3e302 100644 --- a/packages/ssz/test/unit/byType/union/invalid.test.ts +++ b/packages/ssz/test/unit/byType/union/invalid.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {UintNumberType, UnionType, NoneType} from "../../../../src"; -import {runTypeTestInvalid} from "../runTypeTestInvalid"; +import {UintNumberType, UnionType, NoneType} from "../../../../src/index.js"; +import {runTypeTestInvalid} from "../runTypeTestInvalid.js"; const byteType = new UintNumberType(1); const noneType = new NoneType(); diff --git a/packages/ssz/test/unit/byType/union/tree.test.ts b/packages/ssz/test/unit/byType/union/tree.test.ts index e3a67506f..62fee07f5 100644 --- a/packages/ssz/test/unit/byType/union/tree.test.ts +++ b/packages/ssz/test/unit/byType/union/tree.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {UnionType, UintNumberType, NoneType, ValueOf, toHexString} from "../../../../src"; +import {UnionType, UintNumberType, NoneType, ValueOf, toHexString} from "../../../../src/index.js"; const byteType = new UintNumberType(1); const noneType = new NoneType(); diff --git a/packages/ssz/test/unit/byType/union/valid.test.ts b/packages/ssz/test/unit/byType/union/valid.test.ts index 14c068720..a0b4e7738 100644 --- a/packages/ssz/test/unit/byType/union/valid.test.ts +++ b/packages/ssz/test/unit/byType/union/valid.test.ts @@ -1,5 +1,5 @@ -import {ContainerType, UintNumberType, UnionType, NoneType} from "../../../../src"; -import {runTypeTestValid} from "../runTypeTestValid"; +import {ContainerType, UintNumberType, UnionType, NoneType} from "../../../../src/index.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; const number16Type = new UintNumberType(2); const SimpleObject = new ContainerType({ diff --git a/packages/ssz/test/unit/byType/vector/invalid.test.ts b/packages/ssz/test/unit/byType/vector/invalid.test.ts index 8525c1f0f..c641979fa 100644 --- a/packages/ssz/test/unit/byType/vector/invalid.test.ts +++ b/packages/ssz/test/unit/byType/vector/invalid.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; -import {VectorBasicType, VectorCompositeType} from "../../../../src"; -import {byteType, uint16NumType} from "../../../utils/primitiveTypes"; -import {runTypeTestInvalid} from "../runTypeTestInvalid"; +import {VectorBasicType, VectorCompositeType} from "../../../../src/index.js"; +import {byteType, uint16NumType} from "../../../utils/primitiveTypes.js"; +import {runTypeTestInvalid} from "../runTypeTestInvalid.js"; runTypeTestInvalid({ type: new VectorBasicType(uint16NumType, 2), diff --git a/packages/ssz/test/unit/byType/vector/valid.test.ts b/packages/ssz/test/unit/byType/vector/valid.test.ts index bfdd78fb9..20c6deb5c 100644 --- a/packages/ssz/test/unit/byType/vector/valid.test.ts +++ b/packages/ssz/test/unit/byType/vector/valid.test.ts @@ -5,8 +5,8 @@ import { UintNumberType, ByteVectorType, ListBasicType, -} from "../../../../src"; -import {runTypeTestValid} from "../runTypeTestValid"; +} from "../../../../src/index.js"; +import {runTypeTestValid} from "../runTypeTestValid.js"; const rootType = new ByteVectorType(32); const uint64Type = new UintNumberType(8); diff --git a/packages/ssz/test/unit/byType/vectorBasic/tree.test.ts b/packages/ssz/test/unit/byType/vectorBasic/tree.test.ts index 69cebbd84..a0941aed2 100644 --- a/packages/ssz/test/unit/byType/vectorBasic/tree.test.ts +++ b/packages/ssz/test/unit/byType/vectorBasic/tree.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {UintNumberType, VectorBasicType} from "../../../../src"; -import {runViewTestMutation} from "../runViewTestMutation"; +import {UintNumberType, VectorBasicType} from "../../../../src/index.js"; +import {runViewTestMutation} from "../runViewTestMutation.js"; const uint64NumInf = new UintNumberType(8, {clipInfinity: true}); const vectorType = new VectorBasicType(uint64NumInf, 8); diff --git a/packages/ssz/test/unit/byType/vectorComposite/tree.test.ts b/packages/ssz/test/unit/byType/vectorComposite/tree.test.ts index b013cae59..6bb56a4eb 100644 --- a/packages/ssz/test/unit/byType/vectorComposite/tree.test.ts +++ b/packages/ssz/test/unit/byType/vectorComposite/tree.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import {ContainerNodeStructType, ContainerType, UintNumberType, ValueOf, VectorCompositeType} from "../../../../src"; -import {runViewTestMutation} from "../runViewTestMutation"; +import {ContainerNodeStructType, ContainerType, UintNumberType, ValueOf, VectorCompositeType} from "../../../../src/index.js"; +import {runViewTestMutation} from "../runViewTestMutation.js"; const uint64NumInfType = new UintNumberType(8, {clipInfinity: true}); const containerUintsType = new ContainerType( diff --git a/packages/ssz/test/unit/byValue/bitArray.test.ts b/packages/ssz/test/unit/byValue/bitArray.test.ts index cc9683ebd..65e3fc3e3 100644 --- a/packages/ssz/test/unit/byValue/bitArray.test.ts +++ b/packages/ssz/test/unit/byValue/bitArray.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; -import {getUint8ByteToBitBooleanArray, BitArray} from "../../../src/value/bitArray"; -import {BitVectorType} from "../../../src"; -import {linspace} from "../../utils/misc"; +import {getUint8ByteToBitBooleanArray, BitArray} from "../../../src/value/bitArray.js"; +import {BitVectorType} from "../../../src/index.js"; +import {linspace} from "../../utils/misc.js"; const BITS_PER_BYTE = 8; diff --git a/packages/ssz/test/unit/cachePermanentRootStruct.test.ts b/packages/ssz/test/unit/cachePermanentRootStruct.test.ts index 169557a75..259b58889 100644 --- a/packages/ssz/test/unit/cachePermanentRootStruct.test.ts +++ b/packages/ssz/test/unit/cachePermanentRootStruct.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {ContainerType, UintNumberType} from "../../src"; +import {ContainerType, UintNumberType} from "../../src/index.js"; describe("cachePermanentRootStruct", () => { it("should cache permanent root struct", () => { diff --git a/packages/ssz/test/unit/eth2/allForks.test.ts b/packages/ssz/test/unit/eth2/allForks.test.ts index ea4f2b37d..4c50384d5 100644 --- a/packages/ssz/test/unit/eth2/allForks.test.ts +++ b/packages/ssz/test/unit/eth2/allForks.test.ts @@ -1,7 +1,7 @@ import {Node, Tree} from "@chainsafe/persistent-merkle-tree"; -import {CompositeView, CompositeViewDU, ContainerType, ValueOf} from "../../../src"; -import {allForks, altair, bellatrix, phase0, ssz} from "../../lodestarTypes"; -import {ForkName} from "../../utils/fork"; +import {CompositeView, CompositeViewDU, ContainerType, ValueOf} from "../../../src/index.js"; +import {allForks, altair, bellatrix, phase0, ssz} from "../../lodestarTypes/index.js"; +import {ForkName} from "../../utils/fork.js"; /** False variable to not run code but still compile with Typescript */ const alwaysFalse = 0 < 1; diff --git a/packages/ssz/test/unit/eth2/beaconState.test.ts b/packages/ssz/test/unit/eth2/beaconState.test.ts index 9b886f82d..efdb76316 100644 --- a/packages/ssz/test/unit/eth2/beaconState.test.ts +++ b/packages/ssz/test/unit/eth2/beaconState.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; -import {BeaconState} from "../../lodestarTypes/deneb/sszTypes"; -import {ListUintNum64Type} from "../../../src/type/listUintNum64"; -import {altair, phase0, ssz} from "../../lodestarTypes"; -import {BitArray, fromHexString} from "../../../src"; +import {BeaconState} from "../../lodestarTypes/deneb/sszTypes.js"; +import {ListUintNum64Type} from "../../../src/type/listUintNum64.js"; +import {altair, phase0, ssz} from "../../lodestarTypes/index.js"; +import {BitArray, fromHexString} from "../../../src/index.js"; const VALIDATOR_REGISTRY_LIMIT = 1099511627776; export const Balances = new ListUintNum64Type(VALIDATOR_REGISTRY_LIMIT); diff --git a/packages/ssz/test/unit/eth2/caseEth2.test.ts b/packages/ssz/test/unit/eth2/caseEth2.test.ts index cd4a41804..674329192 100644 --- a/packages/ssz/test/unit/eth2/caseEth2.test.ts +++ b/packages/ssz/test/unit/eth2/caseEth2.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {precomputeJsonKey} from "../../../src/type/container"; +import {precomputeJsonKey} from "../../../src/type/container.js"; describe("JSON case eth2", () => { const fieldNameToJsonKeyCsv = getFieldNameToJsonKeyCsv(); diff --git a/packages/ssz/test/unit/eth2/minMaxSize.test.ts b/packages/ssz/test/unit/eth2/minMaxSize.test.ts index ef439ef4b..d6c341037 100644 --- a/packages/ssz/test/unit/eth2/minMaxSize.test.ts +++ b/packages/ssz/test/unit/eth2/minMaxSize.test.ts @@ -1,5 +1,5 @@ -import {ssz} from "../../lodestarTypes"; -import {Type} from "../../../src"; +import {ssz} from "../../lodestarTypes/index.js"; +import {Type} from "../../../src/index.js"; import {expect} from "chai"; enum ForkName { diff --git a/packages/ssz/test/unit/eth2/regressions.test.ts b/packages/ssz/test/unit/eth2/regressions.test.ts index ef48bec9f..298ac09c3 100644 --- a/packages/ssz/test/unit/eth2/regressions.test.ts +++ b/packages/ssz/test/unit/eth2/regressions.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {ssz} from "../../lodestarTypes"; +import {ssz} from "../../lodestarTypes/index.js"; describe("Various issues and regressions of Eth2 types", () => { it("Should push state.validators to ViewDU and update length", () => { diff --git a/packages/ssz/test/unit/eth2/validators.test.ts b/packages/ssz/test/unit/eth2/validators.test.ts index 1cccd6910..bdb68e5bc 100644 --- a/packages/ssz/test/unit/eth2/validators.test.ts +++ b/packages/ssz/test/unit/eth2/validators.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; import {describe, it} from "mocha"; -import {toHexString, ListCompositeType, ValueOf, CompositeViewDU} from "../../../src"; -import {ValidatorContainer, ValidatorNodeStruct} from "../../lodestarTypes/phase0/sszTypes"; +import {toHexString, ListCompositeType, ValueOf, CompositeViewDU} from "../../../src/index.js"; +import {ValidatorContainer, ValidatorNodeStruct} from "../../lodestarTypes/phase0/sszTypes.js"; type Validator = ValueOf; const validator: Validator = { diff --git a/packages/ssz/test/unit/merkleize.test.ts b/packages/ssz/test/unit/merkleize.test.ts index 6b996c8cd..c3a388962 100644 --- a/packages/ssz/test/unit/merkleize.test.ts +++ b/packages/ssz/test/unit/merkleize.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {bitLength, maxChunksToDepth, nextPowerOf2} from "../../src/util/merkleize"; +import {bitLength, maxChunksToDepth, nextPowerOf2} from "../../src/util/merkleize.js"; describe("util / merkleize / bitLength", () => { const bitLengthByIndex = [0, 1, 2, 2, 3, 3, 3, 3, 4, 4]; diff --git a/packages/ssz/test/unit/named.test.ts b/packages/ssz/test/unit/named.test.ts index 704de061a..a02769778 100644 --- a/packages/ssz/test/unit/named.test.ts +++ b/packages/ssz/test/unit/named.test.ts @@ -14,7 +14,7 @@ import { UnionType, VectorBasicType, VectorCompositeType, -} from "../../src"; +} from "../../src/index.js"; describe("Customize object name for all types", () => { const typeName = "CustomType1234"; diff --git a/packages/ssz/test/unit/packing.test.ts b/packages/ssz/test/unit/packing.test.ts index 816ffd0f1..c3bab2527 100644 --- a/packages/ssz/test/unit/packing.test.ts +++ b/packages/ssz/test/unit/packing.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {UintBigintType, toHexString, VectorBasicType} from "../../src"; +import {UintBigintType, toHexString, VectorBasicType} from "../../src/index.js"; describe("uint packing", () => { const uint8 = new UintBigintType(1); diff --git a/packages/ssz/test/unit/regressions.test.ts b/packages/ssz/test/unit/regressions.test.ts index 6dc0c22fa..749634438 100644 --- a/packages/ssz/test/unit/regressions.test.ts +++ b/packages/ssz/test/unit/regressions.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {uint32NumType, uint64NumType} from "../utils/primitiveTypes"; +import {uint32NumType, uint64NumType} from "../utils/primitiveTypes.js"; import { VectorBasicType, ListBasicType, @@ -12,7 +12,7 @@ import { BooleanType, UintBigintType, ValueOf, -} from "../../src"; +} from "../../src/index.js"; // Compilation of various issues from SSZ and Lodestar libs diff --git a/packages/ssz/test/unit/snapshot.test.ts b/packages/ssz/test/unit/snapshot.test.ts index 6c07ffea5..24decdb39 100644 --- a/packages/ssz/test/unit/snapshot.test.ts +++ b/packages/ssz/test/unit/snapshot.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; import {describe, it} from "mocha"; -import {ByteVectorType} from "../../src/type/byteVector"; -import {ListCompositeType} from "../../src"; -import {PartialListCompositeType} from "../../src/type/partialListComposite"; +import {ByteVectorType} from "../../src/type/byteVector.js"; +import {ListCompositeType} from "../../src/index.js"; +import {PartialListCompositeType} from "../../src/type/partialListComposite.js"; import {Tree, toGindex} from "@chainsafe/persistent-merkle-tree"; describe("snapshot", () => { diff --git a/packages/ssz/test/unit/specTestYamlLoader.test.ts b/packages/ssz/test/unit/specTestYamlLoader.test.ts index 4d08d245f..5c198ae89 100644 --- a/packages/ssz/test/unit/specTestYamlLoader.test.ts +++ b/packages/ssz/test/unit/specTestYamlLoader.test.ts @@ -1,8 +1,8 @@ import {expect} from "chai"; import jsyaml from "js-yaml"; -import {readYamlNumbersAsStrings} from "../spec/testRunner"; -import {BeaconBlockHeader} from "../lodestarTypes/phase0/sszTypes"; -import {toHexString} from "../../src"; +import {readYamlNumbersAsStrings} from "../spec/testRunner.js"; +import {BeaconBlockHeader} from "../lodestarTypes/phase0/sszTypes.js"; +import {toHexString} from "../../src/index.js"; /* eslint-disable quotes */ diff --git a/packages/ssz/test/unit/strings.test.ts b/packages/ssz/test/unit/strings.test.ts index f6413ca15..f5f27e82f 100644 --- a/packages/ssz/test/unit/strings.test.ts +++ b/packages/ssz/test/unit/strings.test.ts @@ -1,7 +1,7 @@ import {expect} from "chai"; -import {Case} from "../../src/util/strings"; -import {KeyCase} from "../../src/type/container"; +import {Case} from "../../src/util/strings.js"; +import {KeyCase} from "../../src/type/container.js"; const testCases = ["fooBar", "foo1Bar", "fooBarBaz", "foo1Bar2Baz", "fooBar1"]; const expectedResults: {[key in KeyCase]: string[]} = { snake: ["foo_bar", "foo1_bar", "foo_bar_baz", "foo1_bar2_baz", "foo_bar1"], diff --git a/packages/ssz/test/unit/unchangedViewDUs.test.ts b/packages/ssz/test/unit/unchangedViewDUs.test.ts index f1e57a36c..824e0d171 100644 --- a/packages/ssz/test/unit/unchangedViewDUs.test.ts +++ b/packages/ssz/test/unit/unchangedViewDUs.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; -import * as sszAltair from "../lodestarTypes/altair/sszTypes"; -import {getRandomState} from "../utils/generateEth2Objs"; +import * as sszAltair from "../lodestarTypes/altair/sszTypes.js"; +import {getRandomState} from "../utils/generateEth2Objs.js"; describe("Unchanged ViewDUs", () => { const state = sszAltair.BeaconState.toViewDU(getRandomState(100)); diff --git a/packages/ssz/test/unit/util/errorPath.test.ts b/packages/ssz/test/unit/util/errorPath.test.ts index 586786428..cd650de78 100644 --- a/packages/ssz/test/unit/util/errorPath.test.ts +++ b/packages/ssz/test/unit/util/errorPath.test.ts @@ -1,8 +1,8 @@ import {assert} from "chai"; import {describe, it} from "mocha"; -import {ContainerType, ListBasicType, ListCompositeType, Type} from "../../../src"; -import {byteType} from "../../utils/primitiveTypes"; +import {ContainerType, ListBasicType, ListCompositeType, Type} from "../../../src/index.js"; +import {byteType} from "../../utils/primitiveTypes.js"; const SimpleObject = new ContainerType({ b: byteType, diff --git a/packages/ssz/test/unit/util/hexString.test.ts b/packages/ssz/test/unit/util/hexString.test.ts index 702c393db..09abba74f 100644 --- a/packages/ssz/test/unit/util/hexString.test.ts +++ b/packages/ssz/test/unit/util/hexString.test.ts @@ -1,6 +1,6 @@ import {expect} from "chai"; import {describe, it} from "mocha"; -import {fromHexString, toHexString} from "../../../src"; +import {fromHexString, toHexString} from "../../../src/index.js"; describe("util / byteArray / toHexString + fromHexString", () => { const testCases: string[] = [ diff --git a/packages/ssz/test/unit/util/proof.test.ts b/packages/ssz/test/unit/util/proof.test.ts index ab790b609..f14d10402 100644 --- a/packages/ssz/test/unit/util/proof.test.ts +++ b/packages/ssz/test/unit/util/proof.test.ts @@ -1,9 +1,9 @@ import {Tree} from "@chainsafe/persistent-merkle-tree"; import {expect} from "chai"; -import {ContainerNodeStructType, ContainerType, ListCompositeType} from "../../../src"; -import {bytes32Type, uint16NumType} from "../../utils/primitiveTypes"; -import {treePartialToJsonPaths, TreeDataTypeCode} from "../../../src/util/proof/treePartialToJsonPaths"; -import {treePostProcessFromProofNode} from "../../../src/util/proof/treePostProcessFromProofNode"; +import {ContainerNodeStructType, ContainerType, ListCompositeType} from "../../../src/index.js"; +import {bytes32Type, uint16NumType} from "../../utils/primitiveTypes.js"; +import {treePartialToJsonPaths, TreeDataTypeCode} from "../../../src/util/proof/treePartialToJsonPaths.js"; +import {treePostProcessFromProofNode} from "../../../src/util/proof/treePostProcessFromProofNode.js"; describe("Create proof of Array of Objects", () => { const SimpleObject = new ContainerType({a: uint16NumType, b: uint16NumType}, {typeName: "SimpleObject"}); diff --git a/packages/ssz/test/unit/util/proofs.test.ts b/packages/ssz/test/unit/util/proofs.test.ts index 5a4271f4c..f1a9632ad 100644 --- a/packages/ssz/test/unit/util/proofs.test.ts +++ b/packages/ssz/test/unit/util/proofs.test.ts @@ -1,5 +1,5 @@ import {expect} from "chai"; -import {BitVectorType, BitListType, ContainerType} from "../../../src"; +import {BitVectorType, BitListType, ContainerType} from "../../../src/index.js"; /** Pick bitLen to fill 2 nodes */ const bitLen2Nodes = 8 * 32 * 2; diff --git a/packages/ssz/test/utils/generateEth2Objs.ts b/packages/ssz/test/utils/generateEth2Objs.ts index d057484cd..c1ab58fd1 100644 --- a/packages/ssz/test/utils/generateEth2Objs.ts +++ b/packages/ssz/test/utils/generateEth2Objs.ts @@ -1,7 +1,7 @@ -import * as sszAltair from "../lodestarTypes/altair/sszTypes"; -import {Attestation, SignedAggregateAndProof, SignedBeaconBlock, Validator} from "../lodestarTypes/phase0/types"; -import {SignedContributionAndProof, BeaconState, SyncCommitteeMessage} from "../lodestarTypes/altair/types"; -import {BitArray} from "../../src"; +import * as sszAltair from "../lodestarTypes/altair/sszTypes.js"; +import {Attestation, SignedAggregateAndProof, SignedBeaconBlock, Validator} from "../lodestarTypes/phase0/types.js"; +import {SignedContributionAndProof, BeaconState, SyncCommitteeMessage} from "../lodestarTypes/altair/types.js"; +import {BitArray} from "../../src/index.js"; // Typical mainnet numbers const BITS_PER_ATTESTATION = 90; diff --git a/packages/ssz/test/utils/primitiveTypes.ts b/packages/ssz/test/utils/primitiveTypes.ts index 9d521ba60..2bf85e3bf 100644 --- a/packages/ssz/test/utils/primitiveTypes.ts +++ b/packages/ssz/test/utils/primitiveTypes.ts @@ -1,5 +1,5 @@ // Adapted from https://github.com/prysmaticlabs/prysm/blob/master/shared/ssz/encode_test.go#L296 -import {UintBigintType, ByteVectorType, UintNumberType} from "../../src"; +import {UintBigintType, ByteVectorType, UintNumberType} from "../../src/index.js"; export const byteType = new UintNumberType(1); export const bytes2Type = new ByteVectorType(2);