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

Remove spurious "Using password from environment variable" logs at startup #10865

Merged
merged 2 commits into from
May 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/lib/cli_lib/commands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ open Async
let generate_keypair =
Command.async ~summary:"Generate a new public, private keypair"
(let open Command.Let_syntax in
let env = Secrets.Keypair.env in
if Option.is_some (Sys.getenv env) then
eprintf "Using password from environment variable %s\n" env ;
let%map_open privkey_path = Flag.privkey_write_path in
Exceptions.handle_nicely
@@ fun () ->
let env = Secrets.Keypair.env in
if Option.is_some (Sys.getenv env) then
eprintf "Using password from environment variable %s\n" env ;
let open Deferred.Let_syntax in
let kp = Keypair.create () in
let%bind () = Secrets.Keypair.Terminal_stdin.write_exn kp ~privkey_path in
Expand Down Expand Up @@ -148,9 +148,6 @@ module Vrf = struct
threshold_met = true in the JSON output), or to generate a witness \
that a 3rd party can use to verify a vrf evaluation."
(let open Command.Let_syntax in
let env = Secrets.Keypair.env in
if Option.is_some (Sys.getenv env) then
eprintf "Using password from environment variable %s\n" env ;
let%map_open privkey_path = Flag.privkey_write_path
and global_slot =
flag "--global-slot" ~doc:"NUM Global slot to evaluate the VRF for"
Expand Down Expand Up @@ -180,6 +177,9 @@ module Vrf = struct
in
Exceptions.handle_nicely
@@ fun () ->
let env = Secrets.Keypair.env in
if Option.is_some (Sys.getenv env) then
eprintf "Using password from environment variable %s\n" env ;
let open Deferred.Let_syntax in
(* TODO-someday: constraint constants from config file. *)
let constraint_constants =
Expand Down Expand Up @@ -239,12 +239,12 @@ module Vrf = struct
\"epochSeed\": _, \"delegatorIndex\": _} JSON message objects read on \
stdin"
(let open Command.Let_syntax in
let env = Secrets.Keypair.env in
if Option.is_some (Sys.getenv env) then
eprintf "Using password from environment variable %s\n" env ;
let%map_open privkey_path = Flag.privkey_write_path in
Exceptions.handle_nicely
@@ fun () ->
let env = Secrets.Keypair.env in
if Option.is_some (Sys.getenv env) then
eprintf "Using password from environment variable %s\n" env ;
let open Deferred.Let_syntax in
(* TODO-someday: constraint constants from config file. *)
let constraint_constants =
Expand Down