Skip to content

Instantly share code, notes, and snippets.

@stefantalpalaru
Created October 17, 2020 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefantalpalaru/3daccc359668c45267d091dd96667490 to your computer and use it in GitHub Desktop.
Save stefantalpalaru/3daccc359668c45267d091dd96667490 to your computer and use it in GitHub Desktop.
@@ -626,10 +626,10 @@ proc importKeystoresFromDir*(rng: var BrHmacDrbgContext,
fatal "Failed to access the imported deposits directory"
quit 1
-template ask(prompt: string): string =
+template ask(destVar, prompt: untyped): untyped =
try:
stdout.write prompt, ": "
- stdin.readLine()
+ destVar = stdin.readLine()
except IOError:
return err "failure to read data from stdin"
@@ -662,8 +662,9 @@ proc pickPasswordAndSaveWallet(rng: var BrHmacDrbgContext,
"to continue with a machine-generated name."
echo ""
+ var enteredName: TaintedString
while true:
- var enteredName = ask "Wallet name"
+ ask(enteredName, "Wallet name")
if enteredName.len > 0:
name =
try:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment