-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[fastx CLI] Improve demo wallet's UX and add option to choose between pretty print or json output #536
Conversation
sui/src/wallet_commands.rs
Outdated
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { | ||
let s = match self { | ||
WalletCommandResult::Publish(cert, effects) => { | ||
if matches!(effects.status, ExecutionStatus::Failure { .. }) { |
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 same as if let ExecutionStatus::Failure {..} = effects.status
right? I think if let is more readable, but this is just a really small thing
sui/src/wallet_commands.rs
Outdated
effects.status | ||
))); | ||
} | ||
vec![ |
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 code pattern is repeated a lot, might want to make a quick fn out of it.
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 just changed these to use fmt:write instead
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 a great set of changes @patrickkuo !
* WalletCommand now returns WalletCommandResult * implement Display and Debug for WalletCommandResult, for pretty print and json output * --no-shell and --json flag is now a global flag
2889f86
to
bb7ff44
Compare
fix gas command
rebased and made Gas command work with the new WalletCommandResult |
sui_types/src/messages.rs
Outdated
writeln!(writer, "Object Arguments : {:?}", c.object_arguments)?; | ||
writeln!(writer, "Pure Arguments : {:?}", c.pure_arguments)?; | ||
writeln!(writer, "Type Arguments : {:?}", c.type_arguments)?; | ||
writeln!(writer, "Gas Budget : {:?}", c.object_arguments)?; |
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.
Duplicate Gas Budget
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.
!! good spot
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.
Thanks @patrickkuo love the latest set of changes, much more compact and easier to read!
…536) * Rename field 'batch' to 'transaction_list' * Remove concept of batches in client facing code * update example docs
…ystenLabs#536) * Rename field 'batch' to 'transaction_list' * Remove concept of batches in client facing code * update example docs
Todo: Update docs
Call :
Transfer:
Example json output: