fix: use byteArrayEquals
This commit is contained in:
parent
b87017eb67
commit
157811b234
|
@ -45,7 +45,7 @@ import {
|
||||||
RPCTx,
|
RPCTx,
|
||||||
} from "./types.js";
|
} from "./types.js";
|
||||||
import { keccak256 } from "ethereum-cryptography/keccak";
|
import { keccak256 } from "ethereum-cryptography/keccak";
|
||||||
import { fromHexString } from "@chainsafe/ssz";
|
import { byteArrayEquals, fromHexString } from "@chainsafe/ssz";
|
||||||
import { RPC } from "#client/rpc.js";
|
import { RPC } from "#client/rpc.js";
|
||||||
|
|
||||||
export interface IClientVerifyingProvider extends IVerifyingProvider {
|
export interface IClientVerifyingProvider extends IVerifyingProvider {
|
||||||
|
@ -640,7 +640,10 @@ export default class VerifyingProvider implements IClientVerifyingProvider {
|
||||||
private verifyCodeHash(code: Bytes, codeHash: Bytes32): boolean {
|
private verifyCodeHash(code: Bytes, codeHash: Bytes32): boolean {
|
||||||
return (
|
return (
|
||||||
(code === "0x" && codeHash === "0x" + KECCAK256_NULL_S) ||
|
(code === "0x" && codeHash === "0x" + KECCAK256_NULL_S) ||
|
||||||
keccak256(fromHexString(codeHash)) === fromHexString(codeHash)
|
byteArrayEquals(
|
||||||
|
keccak256(fromHexString(codeHash)),
|
||||||
|
fromHexString(codeHash),
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue