Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: use named exports to expose different hashers #459

Merged
merged 2 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions packages/persistent-merkle-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,33 @@
"version": "0.9.1",
"description": "Merkle tree implemented as a persistent datastructure",
"type": "module",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": "./lib/index.js",
"types": "./lib/index.d.ts"
},
"./hashtree": {
wemeetagain marked this conversation as resolved.
Show resolved Hide resolved
"import": "./lib/hasher/hashtree.js",
"types": "./lib/hasher/hashtree.d.ts"
},
"./noble": {
"import": "./lib/hasher/noble.js",
"types": "./lib/hasher/noble.d.ts"
},
"./as-sha256": {
"import": "./lib/hasher/as-sha256.js",
"types": "./lib/hasher/as-sha256.d.ts"
}
},
"typesVersions": {
"*": {
"*": [
"*",
"lib/*",
"lib/*/index"
]
}
},
"files": [
"lib"
],
Expand Down
4 changes: 2 additions & 2 deletions setHasher.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Set the hasher to hashtree
// Used to run benchmarks with with visibility into hashtree performance, useful for Lodestar
import {setHasher} from "@chainsafe/persistent-merkle-tree/lib/hasher/index.js";
import {hasher} from "@chainsafe/persistent-merkle-tree/lib/hasher/hashtree.js";
import {setHasher} from "@chainsafe/persistent-merkle-tree";
import {hasher} from "@chainsafe/persistent-merkle-tree/hashtree";
setHasher(hasher);

export {};
Loading