From 7856713abf0a04f94376983ad30973bf5269e15a Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 9 Sep 2023 07:43:54 -0400 Subject: [PATCH] refactor: switch to using hexToBytes --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 75ac2b8..13ea050 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ import { Buffer } from "buffer"; import { Client, factory } from "@lumeweb/libkernel/module"; -import { DataFn, ErrTuple, hexToBuf, logErr } from "@lumeweb/libkernel"; +import { DataFn, ErrTuple, logErr } from "@lumeweb/libkernel"; +import { hexToBytes } from "@lumeweb/libweb"; import { blake2b } from "@noble/hashes/blake2b"; import b4a from "b4a"; @@ -54,8 +55,7 @@ export class SwarmClient extends Client { public async connect(pubkey: string | Uint8Array): Promise { if (typeof pubkey === "string") { - const buf = hexToBuf(pubkey); - pubkey = this.handleErrorOrReturn(buf); + pubkey = hexToBytes(pubkey); } let existing = Array.from(this._sockets.values()).filter((socket) => {