-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[cli] Improve the way we display PTB info in table output #15957
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
4642044
to
92fa49e
Compare
let mut xs = items.into_iter(); | ||
let Some(x) = xs.next() else { | ||
return Ok(()); | ||
}; | ||
write!(f, "{x}")?; | ||
for x in xs { | ||
write!(f, "{sep}{x}")?; |
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.
Improvement as per @amnn's suggestion in a previous PR.
writeln!(writer, "Transaction Kind: Epoch Change")?; | ||
writeln!(writer, "New epoch ID: {}", e.epoch)?; | ||
writeln!(writer, "Storage gas reward: {}", e.storage_charge)?; | ||
writeln!(writer, "Computation gas reward: {}", e.computation_charge)?; | ||
writeln!(writer, "Storage rebate: {}", e.storage_rebate)?; | ||
writeln!(writer, "Timestamp: {}", e.epoch_start_timestamp_ms)?; |
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.
Cosmetic changes, removed a space between name and :
.
writeln!(writer, "Transaction Kind : Programmable")?; | ||
write!(writer, "{p}")?; | ||
write!(writer, "Transaction Kind: Programmable")?; | ||
write!(writer, "{}", crate::displays::Pretty(p))?; |
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 is the main change where the new Pretty display is being used for Programmable TXs.
Does any of this change the replay command output or is this a completely copied over version? In the picture above, input objects is missing a space between the second and third row to align the third row for all input types! |
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.
Adding to Laura's question -- is there a way for us to re-use the implementation that Replay uses for this? (I'm thinking it may not be easy because these are JSONRPC types instead of core types, and then there's a question of whether we even want to invest in cleaning those up if they are going to be replaced soon, but worth checking).
I have not tried to see if replay gets broken, but I am certain it does not. And the reason for that is that this only changes the output for
That's exactly the issue. It is unfortunate that I couldn't use the already implementation of Long term, I think we need to review how these things should work and how GraphQL would affect the Finally, I need this for Wed demo as the broken table is really nasty when executing transactions. Happy to address the feedback as we want after Wed, |
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.
Let me accept to unblock, but note @laura-makdah's comment on alignment of input types.
Style wise, I would add a space in the input object table between the object type and the proceeding value, for all types, such that the third column is aligned. I would also remove the bracketing from the gas payment, and reserve bracketing for data that has both a repeated and grouped pagination |
Description
Improves the way we display PTB info in table output. Previously, the inputs would output all the data in a long String, which breaks the table.
Before
After
Test Plan
Visual inspection.
If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section.
Type of Change (Check all that apply)
Release notes
Improved the display of transactions of type
Transaction Kind: Programmable
in the CLI's output.