Commit Graph

61 Commits

Author SHA1 Message Date
behzad nouri 4ec5ea6f7b
replaces assert!(matches!(...)) with assert_matches!(...) (#33068)
assert_matches!(...) provides more informative error message when it
fails and it is part of nightly rust:
https://doc.rust-lang.org/std/assert_matches/macro.assert_matches.html
2023-08-30 13:48:27 -04:00
Alexander Meißner 67d6d688cc
Refactor - Demotes `Arc` to `Rc`. (#32982)
Demotes `Arc` to `Rc`.
2023-08-25 00:54:06 +02:00
behzad nouri 9524c9dbff patches errors from clippy::uninlined_format_args
https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
2022-12-06 19:32:15 +00:00
Brooks Prumo d1ba42180d
clippy for rust 1.65.0 (#28765) 2022-11-09 19:39:38 +00:00
Denis K 3e395394d2
Fix clippy warnings on Windows (#28720)
Fixed clippy warnings on Windows.
2022-11-02 21:05:21 +00:00
behzad nouri 9a57c64f21
patches clippy errors from new rust nightly release (#27996) 2022-09-22 22:23:03 +00:00
dependabot[bot] 7651ae5039
chore: bump rpassword from 5.0.1 to 6.0.0 (#23638)
* chore: bump rpassword from 5.0.1 to 6.0.0

Bumps [rpassword](https://github.com/conradkleinespel/rpassword) from 5.0.1 to 6.0.0.
- [Release notes](https://github.com/conradkleinespel/rpassword/releases)
- [Commits](https://github.com/conradkleinespel/rpassword/compare/v5.0.1...v6.0.0)

---
updated-dependencies:
- dependency-name: rpassword
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* [auto-commit] Update all Cargo lock files

* Update api

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2022-03-15 00:03:30 +00:00
Michael Vines b8837c04ec Reformat imports to a consistent style for imports
rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
2021-12-03 09:19:13 -08:00
Brian Anderson 96c6ba6eb2
Add docs to solana_clap_utils::keypair (#20665)
* Add docs to solana_clap_utils::keypair

* Apply suggestions from code review

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Move imports to module level in solana_clap_utils::keypair::tests

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-19 17:55:02 +00:00
Trent Nelson 6649dfa899 clap-utils: trim single-quotes from signer uris on windows 2021-10-14 09:09:09 -06:00
Michael Vines 7027d56064 Resolve nightly-2021-10-05 clippy complaints 2021-10-06 10:37:58 -07:00
Alexander Meißner 6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
Trent Nelson 06a926f2f4 Improve missing default filepath signer error messaging 2021-05-28 20:10:36 -06:00
Trent Nelson ca8c1c6c42 Revert "Improve missing default signer error messaging (#17486)"
This reverts commit 6d40d0d141.
2021-05-28 20:10:36 -06:00
Jack May 6d40d0d141
Improve missing default signer error messaging (#17486) 2021-05-25 18:31:27 -07:00
Trent Nelson e320af99a0 clap-utils: Fix signer resolution on Windows 2021-05-21 02:12:57 +00:00
steviez 6cba53421e
Disallow bad combination of arguments in keygen grind (#17251)
* Use constant for outfile sentinel value

* Require --use-mnemonic flag when --no-outfile flag passed to keygen grind
2021-05-18 10:35:07 -05:00
Tyera Eulberg b437b0a49d
Add bip32 support to solana-keygen recover (#17180)
* Fix spelling

* Add validator for  SignerSources

* Add helper to generate Keypair from supporting SignerSources

* Add bip32 support to solana-keygen recover

* Make SignerSourceKind const strs, use for Debug impl and URI schemes
2021-05-12 19:33:11 +00:00
Tyera Eulberg a5ec3a0547
SignerSource: rename input scheme to `prompt`, default to bip44 solana base key (#17154)
* Rename ask to prompt

* Default to Solana bip44 base if no derivation-path

* Add SignerSource legacy field, support legacy ASK

* Update docs

* Fix docs: validator current doesn't support uri SignerSources
2021-05-10 19:28:47 -06:00
Tyera Eulberg 694c674aa6
Implement Bip32 for seed-phrase/passphrase signing (#16942)
* Add Keypair helpers for bip32 derivation

* Plumb bip32 for SignerSourceKind::Ask

* Support full-path querystring

* Use as_ref

* Add public wrappers for from_uri cases

* Support master root derivations (and fix too-deep print

* Add ask:// HD documentation

* Update ASK elsewhere in docs
2021-05-03 19:58:56 -06:00
Tyera Eulberg d6f30b7537
Refactor SignerSource to expose DerivationPath to other kinds of signers (#16933)
* One use statement

* Add stdin uri scheme

* Convert parse_signer_source to return Result

* A-Z deps

* Convert Usb data to Locator

* Pull DerivationPath out of Locator

* Wrap SignerSource to share derivation_path

* Review comments

* Check Filepath existence, readability in parse_signer_source
2021-04-29 01:42:21 -06:00
Michael Vines a911ae00ba clippy 2021-04-18 20:55:02 -07:00
Trent Nelson 6444f0e57b clap-utils: Add explicit schemes for `ask` and `file` `SignerSource`s 2021-04-16 13:56:12 -06:00
Trent Nelson 5d1ef5d01d clap-utils: Use `uriparse` crate to parse `SignerSource` 2021-04-16 13:56:12 -06:00
Trent Nelson c5ab3ba6f1 clap-utils: Reduce SignerSource's visibility 2021-04-16 13:56:12 -06:00
Trent Nelson 09dcc9ea04 clap-utils: Rename KeypairUrl to SignerSource 2021-04-16 13:56:12 -06:00
Trent Nelson 7f0ac6a67c clap-utils: Allow `NullSigner`s outside sign-only mode 2021-03-25 05:45:21 +00:00
Trent Nelson 4e99f1e634 clap-utils: Add helper to `CliSignerInfo` for getting signers for a message 2021-03-16 22:09:46 -06:00
Trent Nelson 672e9c640f CLI: Support dumping the TX message in sign-only mode 2021-03-16 19:20:54 -06:00
Jack May 3316e7166c
Rework upgradeable loader cli (#14209) 2020-12-21 13:02:53 -08:00
guanqun 4451042c76
keygen: add more mnemonic language support (#12944) 2020-10-17 10:51:53 +08:00
Trent Nelson 7cab638297 Factor the rest of CLI offline module out to clap-utils and cli-output crates 2020-09-23 15:58:44 -06:00
Trent Nelson 0c58123b45 Move CLI Signer utils into clap-utils 2020-09-23 15:58:44 -06:00
Michael Vines 0ed7b0561e Improve error message when .config/solana/id.json is not found 2020-09-18 16:29:12 -07:00
Tyera Eulberg 679e7863cb
Tame wallet manager better (#9567)
automerge
2020-04-18 11:54:21 -07:00
Tyera Eulberg ec4745d174
Tame overeager wallet manager (#9262)
* Add helper fn to check for usb cli args

* Use helper fn to prevent wallet_manager connecting unnecessarily

* Review improvements
2020-04-02 15:47:17 -06:00
Trent Nelson 98228c392e
CLI: Add multi-session signing support (#8927)
* SDK: Add `NullSigner` implementation

* SDK: Split `Transaction::verify()` to gain access to results

* CLI: Minor refactor of --sign_only result parsing

* CLI: Enable paritial signing

Signers specified by pubkey, but without a matching --signer arg
supplied fall back to a `NullSigner` when --sign-only is in effect.
This allows their pubkey to be used for TX construction as usual,
but leaves their `sign_message()` a NOP. As such, with --sign-only
in effect, signing and verification must be done separately, with
the latter's per-signature results considered

* CLI: Surface/report missing/bad signers to user

* CLI: Suppress --sign-only JSON output

* nits

* Docs for multi-session offline signing
2020-03-18 20:49:38 -07:00
Tyera Eulberg 3c2aff2b5b
Cli: Add resolve-signer subcommand (#8859)
* Expose remote-wallet device pretty path

* Add resolve-signer helpers

* Add cli resolve-signer subcommand

* Print pretty-path in waiting msg
2020-03-14 20:48:41 -07:00
Michael Vines ce88602ced Surface the missing pubkey 2020-03-13 15:57:41 -07:00
Trent Nelson fbf2dd1672
CLI: Error message cleanup (#8804)
automerge
2020-03-12 23:20:49 -07:00
Greg Fitzgerald 5fa397ceed
Remove --derivation-path option (#8741)
automerge
2020-03-09 17:49:01 -07:00
Tyera Eulberg eab80d0aea
Cli: Fix create-with-seed (#8706)
* Add failing test

* Fix create-address-with-seed regression

* Add apis to enable generating a pubkey from all various signers

* Enable other signers as --from in create-with-seed
2020-03-09 00:02:24 -06:00
sakridge bf8e9b3d71
Better error message for cli (#8702) 2020-03-08 19:19:34 -07:00
Tyera Eulberg a7d1346d51
Remove ask-seed-phrase arg from validator, archiver (#8697)
* Remove ask-seed-phrase from validator

* Update paper-wallet docs

* Remove ask-seed-phrase from archiver

* Remove unused structs, methods
2020-03-06 22:22:23 -07:00
Tyera Eulberg ca8bf8f964
Ledger: return specific error if ledger-app-solana is not running (#8684)
* Specific error if ledger-app-solana is not running

* Return helpful error

* Include signer name in multiple-device prompt
2020-03-06 16:03:23 -07:00
Tyera Eulberg f6f0f94e17
Add flag to confirm key on device (#8478) 2020-02-26 15:24:44 -07:00
Tyera Eulberg 6b99ab3a57
Ledger key path rework (#8453)
automerge
2020-02-25 16:41:21 -08:00
Tyera Eulberg 12a9b5f35e
CLI: collect and deduplicate signers (#8398)
* Rename (keypair util is not a thing)

* Add method to generate_unique_signers

* Cli: refactor signer handling and remote-wallet init

* Fixup unit tests

* Fixup intergation tests

* Update keypair path print statement

* Remove &None

* Use deterministic key in test

* Retain storage-account as index

* Make signer index-handling less brittle

* Cache pubkey on RemoteKeypair::new

* Make signer_of consistent + return pubkey

* Remove &matches double references

* Nonce authorities need special handling
2020-02-24 17:03:30 -07:00
Tyera Eulberg 4ddbf8d509
CLI: dynamic signing reboot (#8384)
* Add keypair_util_from_path helper

* Cli: impl config.keypair as a trait object

* SDK: Add Debug and PartialEq for dyn Signer

* ClapUtils: Arg parsing from pubkey+signers to Presigner

* Impl Signers for &dyn Signer collections

* CLI: Add helper for getting signers from args

* CLI: Replace SigningAuthority with Signer trait-objs

* CLI: Drop disused signers command field

* CLI: Drop redundant tests

* Add clap validator that handles all current signer types

* clap_utils: Factor Presigner resolution to helper

* SDK: `From` for boxing Signer implementors to trait objects

* SDK: Derive `Clone` for `Presigner`

* Remove panic

* Cli: dedup signers in transfer for remote-wallet ergonomics

* Update docs vis-a-vis ASK changes

* Cli: update transaction types to use new dynamic-signer methods

* CLI: Fix tests No. 1

what to do about write_keypair outstanding

* Work around `CliConfig`'s signer not necessarily being a `Keypair`

* CLI: Fix tests No. 2

* Remove unused arg

* Remove unused methods

* Move offline arg constants upstream

* Make cli signing fallible

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2020-02-21 14:55:53 -07:00
Tyera Eulberg ab361a8073
Rename KeypairUtil to Signer (#8360)
automerge
2020-02-20 13:28:55 -08:00