Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: checking for keystore file existence #2427

Merged
merged 10 commits into from
Feb 15, 2024
3 changes: 2 additions & 1 deletion waku/waku_rln_relay/group_manager/on_chain/group_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ else:
{.push raises: [].}

import
os,
web3,
web3/ethtypes,
eth/keys as keys,
Expand Down Expand Up @@ -622,7 +623,7 @@ method init*(g: OnchainGroupManager): Future[void] {.async.} =
g.rlnContract = some(rlnContract)
g.registryContract = some(registryContract)

if g.keystorePath.isSome() and g.keystorePassword.isSome():
if g.keystorePath.isSome() and existsFile(g.keystorePath.get()) and g.keystorePassword.isSome():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably want to have a specific error log when a path and password is provided but it doesn't exist, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! Added it now :)) lmk what you think about the new version

var keystoreQuery = KeystoreMembership(
membershipContract: MembershipContract(
chainId: $g.chainId.get(),
Expand Down
Loading