mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-07 16:33:08 +00:00
chore: better keystore management (#3358)
This commit is contained in:
parent
06562d7a56
commit
b1344bb3b1
@ -61,7 +61,9 @@ proc loadAppKeystore*(
|
|||||||
return err(
|
return err(
|
||||||
AppKeystoreError(kind: KeystoreOsError, msg: "Cannot open file for reading")
|
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)
|
# We iterate over each substring split by separator (which we expect to correspond to a single keystore json)
|
||||||
for keystore in fileContents.split(separator):
|
for keystore in fileContents.split(separator):
|
||||||
@ -159,8 +161,7 @@ proc loadAppKeystore*(
|
|||||||
|
|
||||||
return err(
|
return err(
|
||||||
AppKeystoreError(
|
AppKeystoreError(
|
||||||
kind: KeystoreKeystoreDoesNotExist,
|
kind: KeystoreKeystoreDoesNotExist, msg: "The keystore file could not be parsed"
|
||||||
msg: "No keystore found for the passed parameters",
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user