Remove unused code

This commit is contained in:
Franck Royer 2022-05-20 11:27:57 +10:00
parent 17c8335d6f
commit 5e1cd78288
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 1 additions and 8 deletions

View File

@ -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)));
}