sui
sui copied to clipboard
[cli][refactor] Move all the commands logic into a macro to reduce code duplication
Description
Moved all the transaction-execution commands' logic into a macro to reduce code duplication. With this change, a few other changes happened
- moved the displays module outside of the
client_ptbmodule, - moved the pretty pretting for
DryRunTransactionBlockResponseto its own display module. We should probably move more of those to their own display module, but for now this is fine. - each tx call returns a
SuiTransactionBlockResponse, and thus changed the very specific results for Call,SplitCoins,MergeCoins,Transfer*,Pay* to use theSuiClientCommandsResult::TransactionBlocktype, which simplifies a lot the code.
Test plan
Existing tests.
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.
- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| sui-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 10, 2024 0:45am |
3 Ignored Deployments
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| multisig-toolkit | ⬜️ Ignored (Inspect) | Visit Preview | May 10, 2024 0:45am | |
| sui-kiosk | ⬜️ Ignored (Inspect) | Visit Preview | May 10, 2024 0:45am | |
| sui-typescript-docs | ⬜️ Ignored (Inspect) | Visit Preview | May 10, 2024 0:45am |
@stefan-mysten is attempting to deploy a commit to the Mysten Labs Team on Vercel.
A member of the Team first needs to authorize it.
Some small clean-ups here and there but this is really much nicer than what was there before, thanks @stefan-mysten !
Thanks for all the excellent suggestions! Fixed everything except the internal error question, as I think that'd be indeed an internal error (or network error, which probably will error before getting there?)