fix anchor keys list command (#2063)

* fix anchor keys list command

* changelog

Co-authored-by: henrye <henry@notanemail>
This commit is contained in:
skrrb 2022-12-05 16:50:31 +01:00 committed by GitHub
parent 0ba2195ec7
commit fb714b9343
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -72,6 +72,7 @@ The minor version will be incremented upon a breaking change and the patch versi
### Fixes
- cli: Fix `anchor keys list` reading the `target` folder in the wrong path ([#2063](https://github.com/coral-xyz/anchor/pull/2063)).
- cli: Move `overflow-checks` into workspace `Cargo.toml` so that it will not be ignored by compiler ([#1806](https://github.com/coral-xyz/anchor/pull/1806)).
- lang: Fix missing account name information when deserialization fails when using `init` or `zero` ([#1800](https://github.com/coral-xyz/anchor/pull/1800)).
- ts: Expose the wallet's publickey on the Provider ([#1845](https://github.com/coral-xyz/anchor/pull/1845)).

View File

@ -3046,12 +3046,13 @@ fn keys(cfg_override: &ConfigOverride, cmd: KeysCommand) -> Result<()> {
}
fn keys_list(cfg_override: &ConfigOverride) -> Result<()> {
let cfg = Config::discover(cfg_override)?.expect("Not in workspace.");
for program in cfg.read_all_programs()? {
let pubkey = program.pubkey()?;
println!("{}: {}", program.lib_name, pubkey);
}
Ok(())
with_workspace(cfg_override, |cfg| {
for program in cfg.read_all_programs()? {
let pubkey = program.pubkey()?;
println!("{}: {}", program.lib_name, pubkey);
}
Ok(())
})
}
fn localnet(