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

[cli][easy] Add serialize-signed-transaction and serialize-unsigned transaction flags for sui client ptb command #16905

Merged
merged 3 commits into from
Mar 28, 2024

Conversation

stefan-mysten
Copy link
Contributor

@stefan-mysten stefan-mysten commented Mar 27, 2024

Description

Add support for the serialize-signed-transaction and serialize-unsigned-transaction flags that output transaction bytes instead of executing the transaction for the sui client ptb command.

Test Plan

Existing tests as this uses the serialize-or-execute macro.


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)

  • protocol change
  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

Added support for the serialize-signed-transaction and serialize-unsigned-transaction flags that output transaction bytes instead of executing the transaction for the sui client ptb command.

@stefan-mysten stefan-mysten requested review from tzakian, bmwill and a team March 27, 2024 15:39
Copy link

vercel bot commented Mar 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 4:04pm
multisig-toolkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 4:04pm
mysten-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 4:04pm
sui-core ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 4:04pm
sui-kiosk ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 4:04pm
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 4:04pm

Copy link
Contributor

@amnn amnn left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @stefan-mysten ! Left a comment that we can perhaps address later, to make client ptb even more consistent with other client commands.

@@ -157,6 +164,17 @@ impl PTB {
program_metadata.gas_budget.value,
gas_price,
);

if program_metadata.serialize_unsigned_set {
serialize_or_execute!(tx_data, true, false, context, PTB).print(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use serialize_or_execute to do more of what's happening below? (Execute the transaction and display it?) It seems like that would help with consistency in general.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we can do that once we add the summary flag to other commands. Then I can probably have everything within this macro for PTB.

@stefan-mysten stefan-mysten merged commit 7b865a0 into MystenLabs:main Mar 28, 2024
45 checks passed
@stefan-mysten stefan-mysten deleted the cli_ptb_unsigned_tx_data branch March 28, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants