-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cli][ptb] Fix type resolution for primitive type instantiations in P…
…TB CLI (#20078) ## Description Fixes an issue where type layouts were not always returned for all primitive types, and simplifies the APIs around this a bit. ## Test plan Added a repro test and made sure it passed. --- ## 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: Bugfix to allow resolving generic type parameters instantiated with primitive types in the CLI PTB builder. - [ ] Rust SDK: - [ ] REST API:
- Loading branch information
Showing
6 changed files
with
152 additions
and
113 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
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
4 changes: 4 additions & 0 deletions
4
crates/sui/tests/ptb_files/resolution/type_param_resolution.ptb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--move-call 0x2::table::new<address, u64> | ||
--assign table | ||
--move-call 0x2::table::add<address, u64> table @0x2 0 | ||
--transfer-objects [table] @0x0 |
22 changes: 22 additions & 0 deletions
22
crates/sui/tests/snapshots/ptb_files_tests__type_param_resolution.ptb.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
source: crates/sui/tests/ptb_files_tests.rs | ||
expression: "results.join(\"\\n\")" | ||
--- | ||
=== PREVIEW === | ||
╭───────────────────────────────────────────────────────────────╮ | ||
│ PTB Preview │ | ||
├──────────────────┬────────────────────────────────────────────┤ | ||
│ command │ values │ | ||
├──────────────────┼────────────────────────────────────────────┤ | ||
│ move-call │ 0x2::table::new<address, u64> │ | ||
│ assign │ table │ | ||
│ move-call │ 0x2::table::add<address, u64> table @0x2 0 │ | ||
│ transfer-objects │ [table] @0x0 │ | ||
╰──────────────────┴────────────────────────────────────────────╯ | ||
=== BUILT PTB === | ||
Input 0: Pure([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2]) | ||
Input 1: Pure([0, 0, 0, 0, 0, 0, 0, 0]) | ||
Input 2: Pure([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) | ||
Command 0: MoveCall(0x0000000000000000000000000000000000000000000000000000000000000002::table::new<address,u64>()) | ||
Command 1: MoveCall(0x0000000000000000000000000000000000000000000000000000000000000002::table::add<address,u64>(Result(0),Input(0),Input(1))) | ||
Command 2: TransferObjects([Result(0)],Input(2)) |