-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CLI-PTB] Add integer inferrence (#17850)
## 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: - [X] CLI: Added better type inference for integer types, and added better build-time errors for invalid value types. - [ ] Rust SDK:
- Loading branch information
Showing
21 changed files
with
576 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.