From a914fdccc8e3401e10767222e10d103f7d8f79b7 Mon Sep 17 00:00:00 2001 From: Ivan FB <128452529+Ivansete-status@users.noreply.github.com> Date: Fri, 4 Apr 2025 19:19:38 +0200 Subject: [PATCH] chore: better keystore management (#3358) --- waku/waku_keystore/keystore.nim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/waku/waku_keystore/keystore.nim b/waku/waku_keystore/keystore.nim index 9741761ff..6cc4ef701 100644 --- a/waku/waku_keystore/keystore.nim +++ b/waku/waku_keystore/keystore.nim @@ -61,7 +61,9 @@ proc loadAppKeystore*( return err( AppKeystoreError(kind: KeystoreOsError, msg: "Cannot open file for reading") ) - let fileContents = readAll(f) + + ## the next blocks expect the whole keystore.json content to be compacted in one single line + let fileContents = readAll(f).replace(" ", "").replace("\n", "") # We iterate over each substring split by separator (which we expect to correspond to a single keystore json) for keystore in fileContents.split(separator): @@ -159,8 +161,7 @@ proc loadAppKeystore*( return err( AppKeystoreError( - kind: KeystoreKeystoreDoesNotExist, - msg: "No keystore found for the passed parameters", + kind: KeystoreKeystoreDoesNotExist, msg: "The keystore file could not be parsed" ) )