From 5e1cd782885086df2158432d1b5903b488ba5955 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 20 May 2022 11:27:57 +1000 Subject: [PATCH] Remove unused code --- src/lib/enr/v4.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/lib/enr/v4.ts b/src/lib/enr/v4.ts index 55f280ef8e..06afaa0320 100644 --- a/src/lib/enr/v4.ts +++ b/src/lib/enr/v4.ts @@ -32,16 +32,9 @@ 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); - return createNodeId(keccak256(uncompressedPubkey.slice(1))); + return bytesToHex(keccak256(uncompressedPubkey.slice(1))); }