From a0ed2cb248bff1335a7323fccfa3bf861de7613f Mon Sep 17 00:00:00 2001 From: Tuyen Nguyen Date: Thu, 12 Oct 2023 14:32:24 +0700 Subject: [PATCH] fix: set hahser for persistent-merkle-tree inside @chainsafe/ssz --- packages/cli/src/applyPreset.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/cli/src/applyPreset.ts b/packages/cli/src/applyPreset.ts index 760c18dbbcd7..89e4ea1e34cb 100644 --- a/packages/cli/src/applyPreset.ts +++ b/packages/cli/src/applyPreset.ts @@ -5,8 +5,13 @@ import {hasher} from "@chainsafe/persistent-merkle-tree/lib/hasher/as-sha256.js" // eslint-disable-next-line no-restricted-imports, import/no-extraneous-dependencies import {setHasher} from "@chainsafe/persistent-merkle-tree/lib/hasher/index.js"; +// eslint-disable-next-line no-restricted-imports, import/no-extraneous-dependencies +import {setHasher as setHasherSsz} from "@chainsafe/ssz/node_modules/@chainsafe/persistent-merkle-tree/lib/hasher/index.js"; + // without setting this first, persistent-merkle-tree will use noble instead +// there are 2 instances of persistent-merkle-tree so we need to set hasher for all of them setHasher(hasher); +setHasherSsz(hasher); // // ## Rationale