Skip to content

Commit

Permalink
feat: use hashtreeHasher
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Jun 7, 2024
1 parent 750d1c7 commit 042c23b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/persistent-merkle-tree/src/hasher/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Hasher} from "./types";
// import {hasher as nobleHasher} from "./noble";
import {hasher as csHasher} from "./as-sha256";
// import {hasher as csHasher} from "./as-sha256";
import {hasher as hashtreeHasher} from "./hashtree";

export {HashObject} from "@chainsafe/as-sha256/lib/hashObject";
export * from "./types";
export * from "./util";

Expand All @@ -13,7 +13,10 @@ export * from "./util";
*/
// export let hasher: Hasher = nobleHasher;
// For testing purposes, we use the as-sha256 hasher
export let hasher: Hasher = csHasher;
// export let hasher: Hasher = csHasher;

// For testing purposes, we use the hashtree hasher
export let hasher: Hasher = hashtreeHasher;

/**
* Set the hasher to be used across the SSZ codebase
Expand Down
2 changes: 2 additions & 0 deletions packages/persistent-merkle-tree/src/hasher/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type {HashObject} from "@chainsafe/as-sha256/lib/hashObject";
import {HashComputation} from "../node";

export type {HashObject};

export type Hasher = {
/**
* Hash two 32-byte Uint8Arrays
Expand Down

0 comments on commit 042c23b

Please sign in to comment.