Commit Graph

158 Commits

Author SHA1 Message Date
edgerunnergit 19454bf56e
Show error instead of panic on passphrase mismatch during solana-keygen (#35072)
* Show error instead of panic on passphrase mismatch

* Format code
2024-02-06 15:32:06 -05:00
samkim-crypto 6a9a89064b
[clap-v3-utils] Deprecate signer source validation (#33802)
* make `SignerSource` implement `Clone`

* add `SignerSourceParserBuilder`

* deprecate `is_keypair`

* deprecate `is_keypair_or_ask_keyword`

* deprecate `is_prompt_signer_source`

* deprecate `is_pubkey_or_keypair`, `is_valid_pubkey`, and `is_valid_signer`

* deprecate `is_pubkey`

* bump deprecation version to 1.17.2

* temporarily allow deprecation for build

* Apply suggestions from code review

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

* fix typo `SignerSourceParseBuilder` --> `SignerSourceParserBuilder`

* add `allow_` prefix to `SignerSourceParserBuilder` fields

* remove `SignerSourceParserBuilder::new()` and replace it with `Default`

* Update keygen/src/keygen.rs

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* update deprecated version to `1.18.0`

---------

Co-authored-by: Tyera <teulberg@gmail.com>
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2024-01-06 08:19:54 +09:00
samkim-crypto ec36369e47
[clap-v3-utils] Deprecate input validators and add parsers to replace them (#33276)
* add tests for validating `Pubkey` and `Hash`

* add pubkey signature parser

* add parsers for straightforward validators

* add parser for token amounts

* add parser for derivation and seeds

* resolve warnings from deprecations in clap-v3-utils

* remove some deprecated functions from `solana_keygen`

* refactor signer related input parsers into a submodule

* fix deprecation notice for utl

* refactor parsers in `input_validators` to `input_parsers`

* cargo fmt

* Apply suggestions from code review

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* Update clap-v3-utils/src/input_parsers/mod.rs

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* mionr fixes to build

* add deprecation notice for old `input_parsers::signer` functions

* update `UiTokenAmount` to `Amount`

* refactor to-be-deprecated functions back to `input_parsers/mod.rs

* fmt

---------

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2023-09-28 07:03:41 -07:00
Alexander Meißner 9e703f85de
Upgrades Rust to 1.72.0 & nightly-2023-08-25 (#32961)
* allow pedantic invalid cast lint

* allow lint with false-positive triggered by `test-case` crate

* nightly `fmt` correction

* adapt to rust layout changes

* remove dubious test

* Use transmute instead of pointer cast and de/ref when check_aligned is false.

* Renames clippy::integer_arithmetic to clippy::arithmetic_side_effects.

* bump rust nightly to 2023-08-25

* Upgrades Rust to 1.72.0

---------

Co-authored-by: Trent Nelson <trent@solana.com>
2023-09-01 07:26:13 +00:00
Trent Nelson b8dc5daedb
preliminaries for bumping nightly to 2023-08-25 (#33047)
* remove unnecessary hashes around raw string literals

* remove unncessary literal `unwrap()`s

* remove panicking `unwrap()`

* remove unnecessary `unwrap()`

* use `[]` instead of `vec![]` where applicable

* remove (more) unnecessary explicit `into_iter()` calls

* remove redundant pattern matching

* don't cast to same type and constness

* do not `cfg(any(...` a single item

* remove needless pass by `&mut`

* prefer `or_default()` to `or_insert_with(T::default())`

* `filter_map()` better written as `filter()`

* incorrect `PartialOrd` impl on `Ord` type

* replace "slow zero-filled `Vec` initializations"

* remove redundant local bindings

* add required lifetime to associated constant
2023-08-29 23:05:35 +00:00
Alexander Meißner 67d6d688cc
Refactor - Demotes `Arc` to `Rc`. (#32982)
Demotes `Arc` to `Rc`.
2023-08-25 00:54:06 +02:00
samkim-crypto fd049847a3
[keygen] Use workspace version for `tempfile` (#31722)
use workspace version for `tempfile`
2023-05-19 10:50:00 +09:00
samkim-crypto 618d8cf2a6
[clap-v3-utils, keygen] Refactor mnemonics, derivation path, and argument parsing clap logic in keygen (#30977)
* move mnemonic clap logic from keygen to clap-v3-utils

* move derivation path clap logic from keygen to clap-v3-utils

* move keygen clap logic from keygen to clap-v3-utils

* resolve error from rebase

* resolve conflict from rebase

* reorganize derivation_path and mnemonic as modules inside keygen
2023-05-13 14:30:03 +09:00
dependabot[bot] d6f65ccc27
Bump tempfile from 3.4.0 to 3.5.0 (#31439)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/Stebalien/tempfile/releases)
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/NEWS)
- [Commits](https://github.com/Stebalien/tempfile/commits)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: illia.bobyr@solana.com
2023-05-02 11:29:23 -07:00
Jarry Xiao e14f77790b
Improve keygen grind algo by 10% (#30365)
* Improve algo by 10%

* Fix fmt

* remove trailing whitespace

* Update keygen/src/keygen.rs

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* Fix pubkey! macro usage

* Apply suggestions from code review

Co-authored-by: Kevin Ji <1146876+kevinji@users.noreply.github.com>
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

---------

Co-authored-by: mvines <mvines@gmail.com>
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
Co-authored-by: Tyera <teulberg@gmail.com>
Co-authored-by: Kevin Ji <1146876+kevinji@users.noreply.github.com>
2023-04-05 22:36:13 -06:00
samkim-crypto 0ff8a09041
[keygen] refactor argument parsing logic into separate `app(...)` function and add tests (#31015)
* refactor argument parsing and processing for testing

* add tests for command verify

* add tests for command pubkey

* add tests for command new

* add tests for command grind

* clippy

* be explicit about types

* use `try_get_matches` and tempfile

* clippy

* call `Error::exit` on error from `try_get_matches`
2023-04-06 07:43:52 +09:00
Yihau Chen df3ef111f7
chore: workspace inheritance (#29893)
* introduce workspace.package

* introduce workspace.dependencies

* read version from root cargo.toml

* pass check when version = { workspace = true }

* don't bump version when version = { workspace = true }

* including workspace Cargo.toml when bump version

* programs/sbf use workspace inheritance

* fix increasing cargo version ignore program/sbf/Cargo.toml
2023-02-23 22:01:54 +08:00
Michael Vines 5136ed3448
Update homepage value for all crates (#30444) 2023-02-23 02:20:18 +00:00
Will Hickey 04a6a631bc
Bump version to v1.16 (#30028) 2023-01-31 17:48:33 -06:00
joeaba a12bf8c003
Update maintainers references (#29997)
* update maintainers references

* chore: update maintainers reference
2023-01-31 08:07:13 -05:00
Yihau Chen 9193b4221d
Revert "chore: workspace inheritance (#29509)" (#29892)
This reverts commit a67d239dde.
2023-01-25 15:50:41 +08:00
Yihau Chen a67d239dde
chore: workspace inheritance (#29509)
* introduce workspace.package

* introduce workspace.dependencies

* read version from root cargo.toml

* pass check when version = { workspace = true }

* don't bump version when version = { workspace = true }

* including workspace Cargo.toml when bump version

* programs/sbf use workspace inheritance

* fix increasing cargo version ignore program/sbf/Cargo.toml
2023-01-25 13:59:59 +08: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
behzad nouri 9a57c64f21
patches clippy errors from new rust nightly release (#27996) 2022-09-22 22:23:03 +00:00
Will Hickey c0e4379f43
Whickey/version v1.15 (#27739)
* Bump version to v1.13.0
* Bump version to v1.14.0
* Bump version to v1.15.0
2022-09-13 09:06:15 -05:00
DimAn 6899af26b0
keygen: add the ability to use derivation path for new & grind commands (#21614)
* keygen: add --use-derivation-path for new & grind

* keygen: add prompt:// uri scheme to new and grind

* fmt

* migrate to clap-v3-utils

* Revert "migrate to clap-v3-utils"

This reverts commit 77f33262ce6c4e95ac1cc62cca32749516f7f357.

* Revert "fmt"

This reverts commit 038cd4ce9628c57dec1f5a4716e2c5baacbe57b3.

* Revert "keygen: add prompt:// uri scheme to new and grind"

This reverts commit 029ea61409a1a16ba2c45483ade2c01f84f25fac.

* - remove `use` from arg
- fix issue from first commit with default value for derivation path
- refactor arg definition and acquiring
2022-09-07 14:31:40 -04:00
Will Hickey ed8c224374
Bump version to v1.12 (#26967) 2022-08-06 13:20:30 -05:00
github-actions[bot] fbf1bf6d86
Bump Version to 1.11.6 (#26906)
Co-authored-by: willhickey <willhickey@users.noreply.github.com>
2022-08-03 12:48:43 -05:00
github-actions[bot] 5d038b9d2a
Bump Version to 1.11.5 (#26758)
Co-authored-by: willhickey <willhickey@users.noreply.github.com>
2022-07-25 13:05:14 -06:00
github-actions[bot] fd5df1cf25
Bump Version to 1.11.4 (#26578)
Co-authored-by: willhickey <willhickey@users.noreply.github.com>
2022-07-11 23:30:38 -05:00
github-actions[bot] 9d937fb8a0
Bump Version to 1.11.3 (#26481)
Co-authored-by: willhickey <willhickey@users.noreply.github.com>
2022-07-07 14:39:46 -05:00
github-actions[bot] 5c2f819f99
Bump Version to 1.11.2 (#26159) 2022-06-22 21:16:18 -05:00
Will Hickey 51f26dc96e
Bump version to 1.11.1 (#26104) 2022-06-21 12:07:46 -05:00
DimAn e52157b98b
keygen: fix debug build after migration to clap-v3-utils (#24686) 2022-04-26 21:21:07 +02:00
kirill lykov a22101489c
Clap v3 update: keygen (#24479)
* update clap to v3: keygen

* use clap-v3-utils

* update Cargo.lock

* address PR comments

* get rid of unnecessary generic for clap validator
2022-04-22 12:40:53 +02:00
Will Hickey c4ecfa5716
Bump version to v1.11 (#23807)
* Revert crossbeam_epoch to stable. 0.9.8 only works with nightly
* Remove unneeded unit expression
2022-03-21 17:40:50 -05:00
Will Hickey 2f58c9e501
Bump version to 1.10.4 (#23743) 2022-03-17 14:02:13 -05:00
Will Hickey 63bf0f66af
Bump version to 1.10.3 (#23648) 2022-03-14 11:18:45 -05:00
Will Hickey b444836a97
Bump version to 1.10.2 (#23597) 2022-03-10 16:41:06 -06:00
Will Hickey 1a99251498
Bump version to 1.10.1 (#23453) 2022-03-02 13:47:01 -06:00
dependabot[bot] 41ec7c8be9
chore: bump num_cpus from 1.13.0 to 1.13.1 (#22044)
* chore: bump num_cpus from 1.13.0 to 1.13.1

Bumps [num_cpus](https://github.com/seanmonstar/num_cpus) from 1.13.0 to 1.13.1.
- [Release notes](https://github.com/seanmonstar/num_cpus/releases)
- [Changelog](https://github.com/seanmonstar/num_cpus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/num_cpus/compare/v1.13.0...v1.13.1)

---
updated-dependencies:
- dependency-name: num_cpus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-12-21 00:06:14 -07:00
Peter Johnson e92a81b741
typo: lanaguage -> language (#22009) 2021-12-19 22:33:21 -07:00
Trent Nelson d6f22433d0 Bump version to v1.10.0 2021-12-04 20:17:54 +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
Michael Vines dd12d90eac Upgrade to Rust 2021 2021-11-30 20:43:46 -08:00
Trent Nelson 767f740305 Bump version to 1.9.0 2021-10-06 17:57:41 -07:00
dependabot[bot] bcf92b63bf
chore: bump tiny-bip39 from 0.8.1 to 0.8.2 (#20346)
* chore: bump tiny-bip39 from 0.8.1 to 0.8.2

Bumps [tiny-bip39](https://github.com/maciejhirsz/tiny-bip39) from 0.8.1 to 0.8.2.
- [Release notes](https://github.com/maciejhirsz/tiny-bip39/releases)
- [Changelog](https://github.com/maciejhirsz/tiny-bip39/blob/master/CHANGELOG.md)
- [Commits](https://github.com/maciejhirsz/tiny-bip39/compare/v0.8.1...v0.8.2)

---
updated-dependencies:
- dependency-name: tiny-bip39
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-09-30 13:19:12 -06:00
dependabot[bot] 038d77347a
chore: bump tiny-bip39 from 0.8.0 to 0.8.1 (#20136)
* chore: bump tiny-bip39 from 0.8.0 to 0.8.1

Bumps [tiny-bip39](https://github.com/maciejhirsz/tiny-bip39) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/maciejhirsz/tiny-bip39/releases)
- [Changelog](https://github.com/maciejhirsz/tiny-bip39/blob/master/CHANGELOG.md)
- [Commits](https://github.com/maciejhirsz/tiny-bip39/compare/v0.8.0...v0.8.1)

---
updated-dependencies:
- dependency-name: tiny-bip39
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <anatoly+githubjenkins@solana.io>
2021-09-23 10:31:14 -06:00
Alexander Meißner 6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
Tyera Eulberg 22c356d24c
Don't require non-existent param for keygen new (#17896) 2021-06-11 19:25:03 +00:00
dependabot[bot] 86c07bf785
Bump bs58 from 0.3.1 to 0.4.0 (#17573)
* Bump bs58 from 0.3.1 to 0.4.0

Bumps [bs58](https://github.com/mycorrhiza/bs58-rs) from 0.3.1 to 0.4.0.
- [Release notes](https://github.com/mycorrhiza/bs58-rs/releases)
- [Commits](https://github.com/mycorrhiza/bs58-rs/compare/0.3.1...0.4.0)

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

* Fixup

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-05-28 18:30:34 +00:00
Michael Vines 8eab0e8602
Bump version to v1.8.0 (#17541) 2021-05-27 08:51:53 -07: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