diff --git a/src/client/verifyingProvider.ts b/src/client/verifyingProvider.ts index 71c6d53..f3449b8 100644 --- a/src/client/verifyingProvider.ts +++ b/src/client/verifyingProvider.ts @@ -45,7 +45,7 @@ import { RPCTx, } from "./types.js"; import { keccak256 } from "ethereum-cryptography/keccak"; -import { fromHexString } from "@chainsafe/ssz"; +import { byteArrayEquals, fromHexString } from "@chainsafe/ssz"; import { RPC } from "#client/rpc.js"; export interface IClientVerifyingProvider extends IVerifyingProvider { @@ -640,7 +640,10 @@ export default class VerifyingProvider implements IClientVerifyingProvider { private verifyCodeHash(code: Bytes, codeHash: Bytes32): boolean { return ( (code === "0x" && codeHash === "0x" + KECCAK256_NULL_S) || - keccak256(fromHexString(codeHash)) === fromHexString(codeHash) + byteArrayEquals( + keccak256(fromHexString(codeHash)), + fromHexString(codeHash), + ) ); }