From e32ea6d7a5e7c2a1664ceebb0b75590e89fdcc32 Mon Sep 17 00:00:00 2001 From: dapplion Date: Wed, 25 Nov 2020 17:56:33 +0000 Subject: [PATCH] Buffer is subclass of Uint8Array --- src/helpers/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/utils.ts b/src/helpers/utils.ts index 2451c50..683b098 100644 --- a/src/helpers/utils.ts +++ b/src/helpers/utils.ts @@ -5,7 +5,7 @@ export function assert(condition: unknown, message = "Assertion failed"): assert } export function hexToBytes(hex: string): Uint8Array { - return Uint8Array.from(Buffer.from(hex.replace("0x", ""), "hex")); + return Buffer.from(hex.replace("0x", ""), "hex"); } export function bytesToHex(bytes: Uint8Array): string {