From 3321fd05e728700a853096b89d3db9c5e0f3eaf0 Mon Sep 17 00:00:00 2001 From: gabrielmer <101006718+gabrielmer@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:07:23 +0300 Subject: [PATCH] returning seqs in libwaku as comma separated strings (#3121) --- .../requests/debug_node_request.nim | 5 +++-- .../requests/discovery_request.nim | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/library/waku_thread/inter_thread_communication/requests/debug_node_request.nim b/library/waku_thread/inter_thread_communication/requests/debug_node_request.nim index 89ccf064e..dbe80b29b 100644 --- a/library/waku_thread/inter_thread_communication/requests/debug_node_request.nim +++ b/library/waku_thread/inter_thread_communication/requests/debug_node_request.nim @@ -1,5 +1,5 @@ import std/json -import chronicles, chronos, results, eth/p2p/discoveryv5/enr +import chronicles, chronos, results, eth/p2p/discoveryv5/enr, strutils import ../../../../waku/factory/waku, ../../../../waku/node/waku_node type DebugNodeMsgType* = enum @@ -28,7 +28,8 @@ proc process*( case self.operation of RETRIEVE_LISTENING_ADDRESSES: - return ok($(%*waku.node.getMultiaddresses())) + ## returns a comma-separated string of the listen addresses + return ok(waku.node.getMultiaddresses().join(",")) of RETRIEVE_MY_ENR: return ok(waku.node.enr.toURI()) diff --git a/library/waku_thread/inter_thread_communication/requests/discovery_request.nim b/library/waku_thread/inter_thread_communication/requests/discovery_request.nim index 281f7cbf0..1ccf8ff37 100644 --- a/library/waku_thread/inter_thread_communication/requests/discovery_request.nim +++ b/library/waku_thread/inter_thread_communication/requests/discovery_request.nim @@ -1,5 +1,5 @@ import std/json -import chronos, chronicles, results, libp2p/multiaddress +import chronos, chronicles, results, strutils, libp2p/multiaddress import ../../../../waku/factory/waku, ../../../../waku/discovery/waku_dnsdisc, @@ -129,7 +129,8 @@ proc process*( error "GET_BOOTSTRAP_NODES failed", error = error return err($error) - return ok($(%*nodes)) + ## returns a comma-separated string of bootstrap nodes' multiaddresses + return ok(nodes.join(",")) of UPDATE_DISCV5_BOOTSTRAP_NODES: updateDiscv5BootstrapNodes($self[].nodes, waku).isOkOr: error "UPDATE_DISCV5_BOOTSTRAP_NODES failed", error = error