Commit Graph

18 Commits

Author SHA1 Message Date
samkim-crypto 3004eaa9bd
[clap-v3-utils] Add functions to parse directly from `SignerSource` (#34678)
* add `_from_source` function variants for signer, keypair, and pubkey

* make `parse_signer_source` an associated function of `SignerSource`

* refactor `SignerSource` into `input_parsers::signer`

* make `_from_source` functions public

* remove unnecessary import
2024-01-25 06:27:02 +09:00
samkim-crypto c071cf5cd0
[clap-v3-utils] Replace `pubkeys_sigs_of` with `try_pubkeys_sigs_of` (#34801)
* replace `pubkeys_sigs_of` with `try_pubkeys_sigs_of`

* propagate error from `try_pubkeys_sigs_of` to the caller
2024-01-20 11:20:51 +09: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 1cc681dd83
[clap-v3-utils] Add replace deprecated `value_of` and `is_present` with `get_one` and `contains_id` (#33184)
* add try variants to input parsers

* replace deprecated `value_of` and `is_present` with `get_one` and `contains_id`
2023-09-12 21:27:38 -07:00
Trent Nelson b13589b588
round two preliminaries for bumping nightly to 2023-08-25 (#33064)
* work around nightly ICE

seems to be something related to `const ref`s in generic contexts...

* allow lint false-positive on ignored trait bounds
2023-08-30 21:46:20 +02:00
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
samkim-crypto 6de581ac08
[clap-v3-utils, sdk, zk-token-sdk] Split `EncodableKey` into `EncodableKey` + `SeedDerivable` (#31668)
* add `SeedDerivable` trait

* implement `SeedDerivable` for `Keypair`

* implement `SeedDerivable` for `ElGamalKeypair`

* update clap-v3-utils to use `EncodableKey + SeedDerivable`

* implement `SeedDerivable` trait for `AeKey`

* implement `EncodableKey` and `SeedDerivable` for `ElGamalSecretKey`

* implement `SeedDerivable` trait for `ElGamalPubkey`
2023-05-17 17:42:35 +09:00
samkim-crypto 39705afc38
[clap-v3-utils] Fix output type of `ae_key_from_seed_phrase` (#31666)
fix output type of `ae_key_from_seed_phrase`
2023-05-17 09:03:29 +09:00
samkim-crypto e14384d8ff
[clap-v3-utils] Add `EncodableKeypair` trait and make `confirm_keypair_pubkey` generic (#31642)
* add `EncodableKeypair` trait

* implement `EncodableKeypair` for `Keypair`

* implement `EncodableKeypair` for `ElGamalKeypair

* make confirm pubkey functions generic

* fix a typo

* Update sdk/src/signer/keypair.rs

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

* Update clap-v3-utils/src/keypair.rs

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

* fix a typo

---------

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
Co-authored-by: Tyera <teulberg@gmail.com>
2023-05-17 05:37:59 +09:00
samkim-crypto 21667660e9
[zk-token-sdk, clap-v3-utils] Implement `EncodableKey` for encryption keys (#31496)
* implement EncodableKey for ElGamalKeypair

* implement EncodableKey for AeKey

* add keypair_from_path and keypair_from_seed support for encryption keys

* remove duplicate methods from traits
2023-05-10 06:37:29 +09:00
Tyera 2147f0d056
Fix keygen usb panic (debug only) (#31194)
* Bump clap v3

* Use fallible method to check for confirm_key
2023-04-14 02:21:00 +00:00
samkim-crypto d67fa6c470
[clap-v3-utils] Define `EncodableKey` and make `keypair_from_path` and `keypair_from_seed` generic functions (#30947)
* generalize `Keypair` to using `EncodableKey` trait in clap-v3-utils

* add associated `Pubkey` type to `EncodableKey`

* remove associated type `Pubkey` from `EncodableKey`

* rename `EncodableKey` associated function names

* remove default overrides for `{read,write}_file`

* resolve dependencies for test

* remove `pubkey_string` from `EncodableKey` trait
2023-04-06 07:42:11 +09: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
kirill lykov 76c80d9573
Add clap-v3-utils (#24096)
* Add clap-utils-v3

* update Cargo.lock

* address PR comment: rename crate

* address PR comment: rename to clap-v3-utils

* update dep version

* fix clippy errors

* update Cargo.lock
2022-04-19 11:48:34 +02:00