Skip to content

Commit

Permalink
fix: Don't read auth in quill generate (#181)
Browse files Browse the repository at this point in the history
Stops quill from trying to read the provided pem file when running `quill generate`. Fixes #178.
  • Loading branch information
adamspofford-dfinity authored Mar 23, 2023
1 parent b0f5633 commit f1b99d4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

- Fixed `quill generate` requiring authentication. (#181)
- Require an additional `--already-transferred` flag for the single-message form of `quill neuron-stake`. (#173)
- Added `--disburse-amount` and `--disburse-to` to `quill neuron-manage`. (#171)
- Accepts bare principals and ICRC-1 account IDs in `quill account-balance` and `quill transfer`. (#168)
Expand Down
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ fn main() -> AnyhowResult {
let opts = CliOpts::parse();
let qr = opts.global_opts.qr;
let fetch_root_key = opts.global_opts.fetch_root_key;
let auth = get_auth(opts.global_opts)?;
let auth = if let commands::Command::Generate(_) = &opts.command {
AuthInfo::NoAuth
} else {
get_auth(opts.global_opts)?
};
commands::dispatch(&auth, opts.command, fetch_root_key, qr)?;
Ok(())
}
Expand Down
4 changes: 4 additions & 0 deletions tests/commands/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
p=$(mktemp)
err=$(mktemp)
"$QUILL" generate --phrase "tornado allow zero warm have deer wool finish tiger ski dynamic strong" --seed-file /dev/null --overwrite-seed-file --pem-file "$p" --overwrite-pem-file &> "$err" || { cat "$err" >&2 && exit 1 ; }
"$QUILL" public-ids --pem-file "$p"
2 changes: 2 additions & 0 deletions tests/outputs/generate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Principal id: beckf-r6bg7-t6ju6-s7k45-b5jtj-mcm57-zjaie-svgrr-7ekzs-55v75-sae
Account id: ffc463646a2c92dce58d1179d26c64d4ccbaf1079a6edc5628cedc0d4b3b1866

0 comments on commit f1b99d4

Please sign in to comment.