-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[4/n][enums] Move enums all of the Move tests #17246
[4/n][enums] Move enums all of the Move tests #17246
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
96fab27
to
060990f
Compare
2ce2dab
to
e8d8c5d
Compare
060990f
to
6c5ab65
Compare
e8d8c5d
to
3ac0bb8
Compare
6c5ab65
to
0b0e5bd
Compare
3ac0bb8
to
f7c5349
Compare
Should we preserve / move the |
0b0e5bd
to
bcb9f29
Compare
f7c5349
to
9382454
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the new transactonal tests with some feedback
external-crates/move/crates/move-compiler-transactional-tests/tests/matching/abc_match_ref.move
Outdated
Show resolved
Hide resolved
...l-crates/move/crates/move-compiler-transactional-tests/tests/matching/abc_match_mut_ref.move
Outdated
Show resolved
Hide resolved
...nal-crates/move/crates/move-compiler-transactional-tests/tests/matching/abc_match_twice.move
Show resolved
Hide resolved
...nal-crates/move/crates/move-compiler-transactional-tests/tests/matching/at_pattern_copy.move
Outdated
Show resolved
Hide resolved
...nal-crates/move/crates/move-compiler-transactional-tests/tests/matching/at_pattern_copy.move
Outdated
Show resolved
Hide resolved
...l-crates/move/crates/move-compiler-transactional-tests/tests/matching/guard_backtrack_5.move
Outdated
Show resolved
Hide resolved
external-crates/move/crates/move-compiler-transactional-tests/tests/matching/multi_or.move
Outdated
Show resolved
Hide resolved
...rates/move/crates/move-compiler-transactional-tests/tests/matching/nested_either_borrow.move
Outdated
Show resolved
Hide resolved
...-crates/move/crates/move-compiler-transactional-tests/tests/matching/struct_named_value.move
Outdated
Show resolved
Hide resolved
external-crates/move/crates/move-compiler-transactional-tests/tests/matching/struct_named.move
Outdated
Show resolved
Hide resolved
bcb9f29
to
6a646a2
Compare
9382454
to
eff9b81
Compare
6a646a2
to
1f87170
Compare
f5c830f
to
e25cf32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me but I think bad_guard_2.move
should be disallowed by the compiler outright due to how match is compiled. I'm going to put a diff up soon to address this.
8f1cb35
to
0caf49f
Compare
e25cf32
to
d34a051
Compare
0caf49f
to
9a3dd52
Compare
d34a051
to
5cf287d
Compare
9a3dd52
to
5c315e9
Compare
5cf287d
to
f076f43
Compare
## Description This is the top-level (and final!) PR in the stack for Move enums. This PR * Updates the protocol config to support the new execution version * Adds new e2e adapter tests to make sure we handle enums properly * Updates snapshots for tests (and protocol config snapshots and the like). This also then tests all other tests that have been added below this in the stack (e.g., the package resolver tests, graphql tests, all the Move tests, other misc tests that were added). **NB:** Before landing this we need to determine the best way of turning on the correct binary-version for testing only. So I would encourage mainly looking at the tests (and the updated snapshots for the replay tool). Protocol-config changes, and snapshots for them will need to be updated as this gets closer to landing, and we further concretize the testing/pre-rollout/rollout plan. ## Stack: * #17245 * #17246 * #17247 * #17248 * #17249 * #17250 * #17251 **<< You are here** 🎉 ## Test plan It's pretty much all tests.
## Description Adds support for Move enums to both graphql and json-rpc. This adds a couple different things. At a high level: 1. Adds an interface `IMoveDatatype` that allows for access to common fields between both Move structs and enums (e.g., name, type parameters, abilities). 2. Adds methods `datatype(name: String)` and `datatypes` to `MovePackage` that returns datatypes. Note that datatype names are still sorted in the same way as before in pagination (in particular: it will not be paginated as all structs, then all enums or vis-versa, but paginated in sorted order on the datatype names). This is due to the way `datatypes` is implemented in the package resolver. 3. Adds `MoveEnum` as a GraphQL type and associated machinery. This PR is meant to be a logically-reviewable portion but is not land-able on its own. It must be merged in with the changes in the rest of this stack to be landed. ## Stack: * #17245 * #17246 * #17247 * #17248 * #17249 * #17250 **<< You are here** * #17251 ## Test plan Added new tests in this PR for the new features. --- ## 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: - [X] JSON-RPC: - [X] GraphQL: - [ ] CLI: - [ ] Rust SDK:
## Description Adds support for Move enums to the Sui package resolver crate along with tests for it. This PR is meant to be a logically-reviewable portion but is not land-able on its own. It must be merged in with the changes in the rest of this stack to be landed. ## Stack: * #17245 * #17246 * #17247 * #17248 * #17249 **<< You are here** * #17250 * #17251 ## Test plan Added tests in the PR to make sure we can properly resolve enum types. --- ## 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:
## Description Changes for Move enums in `sui-execution`. Generally nothing surprising. Only thing worth note is that enums are not allowed to be OTWs (see tests in top commit in this stack). This PR is meant to be a logically-reviewable portion but is not land-able on its own. It must be merged in with the changes in the rest of this stack to be landed. ## Stack: * #17245 * #17246 * #17247 * #17248 **<< You are here** * #17249 * #17250 * #17251 ## Test plan Tests in the top commit on this stack.
…ms (#17247) ## Description This PR contains the changes needed for Move enums in sui-types, the protocol config changes (except for bumping the bytecode version), along with other misc/smaller changes that are not easily categorized. This PR is meant to be a logically-reviewable portion but is not land-able on its own. It must be merged in with the changes in the rest of this stack to be landed. ## Stack: * #17245 * #17246 * #17247 **<< You are here** * #17248 * #17249 * #17250 * #17251 ## Test plan Tests are in the top commit in this stack here:
d0a9c1b
into
tzakian/move-enums-implementation
## Description This adds the enums implementation for Move. This PR only contains the changes for enums within `external-crates/move` and nowhere else. This PR _does not_ contain any tests. The tests for these changes can be found in the PR above in the stack. Note that individual commits are cut out within this PR to (hopefully) make the review process a bit easier. ## Stack: * #17245 **<< You are here** * #17246 * #17247 * #17248 * #17249 * #17250 * #17251 ## Test plan Tested in the PR above this. --- ## 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. - [X] Protocol: Adds a new protocol version, and enables Move enums on devnet. - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [X] JSON-RPC: Adds support for Move enum values in returned json-rpc results. - [X] GraphQL: Adds support for Move enum values and types to GraphQL. - [ ] CLI: - [ ] Rust SDK:
Description
This PR consists of tests only! (and updates to exp files of existing tests).
Stack:
Test Plan
File format
Status: Done
Deserializer
Status: Done
-- e.g., if someone manually changed the version of the serialized module
so the version was pre-enums, but contained enum-data inside of it.
Serializer
Status: Done
no version 7 features are used, and that the resulting module can be
deserialized into version 6 and version 7 modules.
Compatibility
Status: Done
Bytecode Verifier
Status: Done
Abilities
check_bounds
check_duplication
enum_defs
instantiaion_loops [each test is an existing test that we have for structs but ported over to enums]
locals_safety
stack_usage_verifier
type_safety
Option
(the actual one this time!) and making sure it typechecks [external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/generic_option.mvir][external-crates/move/crates/bytecode-verifier-transactional-tests/tests/type_safety/vector_type_param.mvir]
VM
Values
Option
is backwards compatible with vectorOption
.