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-PTB] Add integer inferrence #17850

Merged
merged 1 commit into from
May 21, 2024
Merged

[CLI-PTB] Add integer inferrence #17850

merged 1 commit into from
May 21, 2024

Conversation

tzakian
Copy link
Contributor

@tzakian tzakian commented May 21, 2024

Description

Fixes an issue where if a type was not annotated on an integer value we would set its type to u64. This could lead to errors with things like

--make-move-vec <u16> [1,2,3,4]

This now adds an InferredNum argument, and also adds type arguments to pure value serialization at which point we will select the type for the inferred num, if no type is provided we default to a u64.

This also has the added benefit of performing (lightweight!) type checking during the building of the PTB, so we will now get build errors for things like

--make-move-vec <std::option::Option<u64>> [some(some(1))]

Test plan

Added additional tests and updated 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: Added better type inference for integer types, and added better build-time errors for invalid value types.
  • Rust SDK:

Copy link

vercel bot commented May 21, 2024

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

3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) May 21, 2024 5:25pm
sui-kiosk ⬜️ Ignored (Inspect) May 21, 2024 5:25pm
sui-typescript-docs ⬜️ Ignored (Inspect) May 21, 2024 5:25pm

Copy link
Contributor

@stefan-mysten stefan-mysten left a comment

Choose a reason for hiding this comment

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

Nice, thanks for the fix @tzakian

@tzakian tzakian merged commit b958760 into main May 21, 2024
50 checks passed
@tzakian tzakian deleted the tzakian/sui-cli-infer-nums branch May 21, 2024 19:44
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.

None yet

2 participants