From 0b10c2cb4e4d850b1789999836f8f995daa7e03a Mon Sep 17 00:00:00 2001 From: dapplion Date: Thu, 3 Dec 2020 00:31:52 +0000 Subject: [PATCH] Add deleted method in tests util --- test/util.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/util.ts b/test/util.ts index 37e835a..be1f2ad 100644 --- a/test/util.ts +++ b/test/util.ts @@ -13,3 +13,11 @@ export function range(n: number): number[] { for (let i = 0; i < n; i++) nums.push(i); return nums; } + +/** + * ONLY for NodeJS tests, for any other use src/helpers/hex hexToBytes() + * Serves as a "ground-truth" reference + */ +export function hexToBytesNode(hex: string): Buffer { + return Buffer.from(hex.replace("0x", ""), "hex"); +}