chore: better keystore management (#3358)

This commit is contained in:
Ivan FB 2025-04-04 19:19:38 +02:00 committed by GitHub
parent 06562d7a56
commit b1344bb3b1

View File

@ -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"
)
)