-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clap-v3-utils] Add functions to parse directly from SignerSource
#34678
[clap-v3-utils] Add functions to parse directly from SignerSource
#34678
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #34678 +/- ##
=========================================
- Coverage 81.7% 81.7% -0.1%
=========================================
Files 826 826
Lines 223371 223411 +40
=========================================
+ Hits 182578 182588 +10
- Misses 40793 40823 +30 |
@@ -371,148 +367,6 @@ impl DefaultSigner { | |||
} | |||
} | |||
|
|||
#[derive(Debug, Clone)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moving all of these public symbols without leaving re-exports will break all consumers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if I am misunderstanding this, but Is this the case even if SignerSource
is currently restricted within the clap-v3-utils
crate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah i missed that they were both moved and promoted to public simultaneously. generally prefer not to do cosmetic changes like reorging private symbols in the same change set as functionals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm kicking myself for putting SignerSource
in clap-utils at all. The clap dependencies could've been genericized over a couple of closures 🤦
@@ -371,148 +367,6 @@ impl DefaultSigner { | |||
} | |||
} | |||
|
|||
#[derive(Debug, Clone)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah i missed that they were both moved and promoted to public simultaneously. generally prefer not to do cosmetic changes like reorging private symbols in the same change set as functionals
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
…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 (cherry picked from commit 3004eaa)
…urce` (backport of #34678) (#35384) [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 (cherry picked from commit 3004eaa) Co-authored-by: samkim-crypto <[email protected]>
Problem
As described in #33478, the
Arg::validator
is deprecated in clap-v3. The approach specified in #33478 is to naturally useSignerSource
as an intermediate type so that applications can callmatches.get_one::<SignerSource>(...)
to idiomatically validate and parse signer source.A previous PR #33802 added a way to flexibly parse
SignerSource
. What we need now is to parseSigner
,Keypair
, orPubkey
from a source.Summary of Changes
_from_source
variants of the functions that parseSigner
,Keypair
, orPubkey
from "path".parse_signer_source
to be an associated function ofSignerSource
to make the code cleaner.SignerSource
a public type and moved it intoinput_parsers::signer
._from_source
functions public so that downstream cli projects can use it to parseSigner
,Keypair
, orPubkey
.Combined with #33802, this PR replaces the original PR #33478.
Fixes #