Skip to content
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

Fix pubkey-macro args #34410

Merged
merged 6 commits into from
Dec 12, 2023
Merged

Conversation

CriesofCarrots
Copy link
Contributor

@CriesofCarrots CriesofCarrots commented Dec 12, 2023

Problem

In #34288, we discovered there are a bunch of uses of the solana_cli::pubkey macro that add unnecessary punctuation, which ends up goofy. Eg:

$ solana inflation rewards -h
...
ARGS:
    <ADDRESS>...    Address of account to query for rewards. , one of:
                      * a base58-encoded public key
                      * a path to a keypair file
                      * a hyphen; signals a JSON-encoded keypair on stdin
                      * the 'ASK' keyword; to recover a keypair via its seed phrase
                      * a hardware wallet keypair URL (i.e. usb://ledger)

Summary of Changes

Remove periods and spaces. In a couple cases, we include extra information about the address -- I made these into parentheticals, so the punctuation still works. Open to other suggestions, though, as I don't love how it demotes the information.
Update macro to be a complete sentence and adjust args accordingly.
I also fixed one argument definition that was confusing

(edit) Updated example below to match new approach
Fixed pubkeys look like:

$ cargo run -- inflation rewards -h
...
ARGS:
    <ADDRESS>...    Account to query for rewards. Address is one of:
                      * a base58-encoded public key
                      * a path to a keypair file
                      * a hyphen; signals a JSON-encoded keypair on stdin
                      * the 'ASK' keyword; to recover a keypair via its seed phrase
                      * a hardware wallet keypair URL (i.e. usb://ledger)

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Merging #34410 (9b78149) into master (07f3883) will increase coverage by 0.0%.
Report is 1 commits behind head on master.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #34410   +/-   ##
=======================================
  Coverage    81.8%    81.9%           
=======================================
  Files         819      819           
  Lines      221019   221019           
=======================================
+ Hits       180975   181033   +58     
+ Misses      40044    39986   -58     

steviez
steviez previously approved these changes Dec 12, 2023
Copy link
Contributor

@steviez steviez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I threw in a couple of ideas, but I'm also happy with what you have as well. While putting it inside parenthesis kind of "demotes" the information, the information is still present for readers

cli/src/stake.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@steviez steviez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few more nits

cli/src/cluster_query.rs Outdated Show resolved Hide resolved
cli/src/stake.rs Outdated Show resolved Hide resolved
cli/src/wallet.rs Outdated Show resolved Hide resolved
cli/src/stake.rs Outdated Show resolved Hide resolved
@CriesofCarrots
Copy link
Contributor Author

Thanks for the quick reviews!

@CriesofCarrots CriesofCarrots added the automerge Merge this Pull Request automatically once CI passes label Dec 12, 2023
@mergify mergify bot merged commit 636992b into solana-labs:master Dec 12, 2023
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants