diff --git a/src/lib/enr/create.ts b/src/lib/enr/create.ts deleted file mode 100644 index cf9b8936bc..0000000000 --- a/src/lib/enr/create.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { bytesToHex } from "../utils"; - -import { NodeId } from "./types"; - -export function createNodeId(bytes: Uint8Array): NodeId { - if (bytes.length !== 32) { - throw new Error("NodeId must be 32 bytes in length"); - } - return bytesToHex(bytes); -} diff --git a/src/lib/enr/index.ts b/src/lib/enr/index.ts index d5e1296911..92a4208eee 100644 --- a/src/lib/enr/index.ts +++ b/src/lib/enr/index.ts @@ -3,6 +3,5 @@ export const v4 = v4Crypto; export * from "./constants"; export * from "./enr"; export * from "./types"; -export * from "./create"; export * from "./keypair"; export * from "./waku2_codec"; diff --git a/src/lib/enr/v4.ts b/src/lib/enr/v4.ts index f711361f9c..55f280ef8e 100644 --- a/src/lib/enr/v4.ts +++ b/src/lib/enr/v4.ts @@ -3,7 +3,6 @@ import * as secp from "@noble/secp256k1"; import { keccak256 } from "../crypto"; import { bytesToHex } from "../utils"; -import { createNodeId } from "./create"; import { NodeId } from "./types"; export function compressPublicKey(publicKey: Uint8Array): Uint8Array { @@ -33,6 +32,13 @@ export function verify( } } +function createNodeId(bytes: Uint8Array): NodeId { + if (bytes.length !== 32) { + throw new Error("NodeId must be 32 bytes in length"); + } + return bytesToHex(bytes); +} + export function nodeId(pubKey: Uint8Array): NodeId { const publicKey = secp.Point.fromHex(pubKey); const uncompressedPubkey = publicKey.toRawBytes(false);