-
Notifications
You must be signed in to change notification settings - Fork 261
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
Add get-recent-prioritization-fees command to cli #805
Add get-recent-prioritization-fees command to cli #805
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #805 +/- ##
=========================================
- Coverage 82.0% 81.9% -0.1%
=========================================
Files 859 859
Lines 232906 232965 +59
=========================================
- Hits 191079 191028 -51
- Misses 41827 41937 +110 |
0887bd8
to
d6b652b
Compare
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.
We might need to reconsider how we present RPC call results to the user
d6b652b
to
9ad59fb
Compare
9ad59fb
to
b0e3eaa
Compare
b0e3eaa
to
d4ad745
Compare
87cb300
to
1754296
Compare
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.
lgtm
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 haven't looked at the math here yet, but building a String
to return with if verbose
cases doesn't feel great to me, since we already have solana-cli-output handling for regular, quiet, and verbose displays. Can you please put the data in a display struct instead? That will also provide JSON output support by default, which I'm sure people are going to want for this subcommand.
c7c7b11
to
e2e3caa
Compare
Ok, it should support JSON now with cli-output, please check my work. |
e2e3caa
to
72b0480
Compare
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.
lgtm, pending @CriesofCarrots
.unwrap_or(fees.len() as u64) | ||
.min(fees.len() as u64) | ||
.max(1) as usize; |
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.
this can all be enforced with clap
, which hands the user nice guidance instead of doing things silently behind their back
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 have to parse again in an .validator() right? kind of annoying to do, but not perf sensitive and gives better feedback. It's just for the 0 case.
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 have to parse again in an .validator() right?
Yeah. And it is kind of annoying 😅 Honestly, if someone is foolish enough to pass --limit-num-slots 0
, I'm okay with just returning empty/default data. But Trent may feel differently
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.
Math/logic looks good. Just a couple more suggestions on using cli-output, plus Trent's clap suggestions.
cli-output/src/cli_output.rs
Outdated
writeln!(f, "{:<11} {}", self.slot, self.prioritization_fee)?; | ||
Ok(()) |
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.
writeln!(f, "{:<11} {}", self.slot, self.prioritization_fee)?; | |
Ok(()) | |
writeln!(f, "{:<11} {}", self.slot, self.prioritization_fee) |
nit: just a little more concise
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.
changed
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 don't see this change (nit)
098c727
to
1993ff0
Compare
1993ff0
to
d7903dd
Compare
d7903dd
to
afeee2a
Compare
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.
Wfm, but happy to restamp if you add the clap validator
Problem
No method to get recent prioritization fees in the CLI
Summary of Changes
Add a command
Fixes #