-
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.
Format missing module errors in upgrade errors (#20541)
## Description Missing modules errors do not have a file to point to since their file has been removed during upgrade or otherwise unknown since the declaration is gone from its previous file if the file still exists. Align missing modules errors with the behavior of other errors by using Move.toml as the reference point for these errors and pointing to the "package" instead. ## Test plan snapshots --- ## 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: - [ ] REST API:
- Loading branch information
1 parent
a8b3ad3
commit f321519
Showing
15 changed files
with
245 additions
and
57 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
.../sui/src/unit_tests/fixtures/upgrade_errors/missing_module_toml/addresses_first/Move.toml
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,6 @@ | ||
[addresses] | ||
upgrades = "0x0" | ||
|
||
[package] | ||
name = "upgrades" | ||
edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move |
5 changes: 5 additions & 0 deletions
5
crates/sui/src/unit_tests/fixtures/upgrade_errors/missing_module_toml/emoji/Move.toml
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,5 @@ | ||
# Emojis are 4 bytes long, this test ensures proper parsing of UTF-8 bytes and check for improper mixing of byte and character indexes. | ||
😀[package]😀 | ||
😀 | ||
😀name = "emoji"😀 | ||
😀 |
Empty file.
1 change: 1 addition & 0 deletions
1
.../sui/src/unit_tests/fixtures/upgrade_errors/missing_module_toml/package_no_name/Move.toml
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 @@ | ||
[package] |
7 changes: 7 additions & 0 deletions
7
...i/src/unit_tests/fixtures/upgrade_errors/missing_module_toml/starts_second_line/Move.toml
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,7 @@ | ||
|
||
[package] | ||
name = "upgrades" | ||
edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move | ||
|
||
[addresses] | ||
upgrades = "0x0" |
2 changes: 2 additions & 0 deletions
2
crates/sui/src/unit_tests/fixtures/upgrade_errors/missing_module_toml/whitespace/Move.toml
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,2 @@ | ||
|
||
|
13 changes: 13 additions & 0 deletions
13
...s/snapshots/sui__upgrade_compatibility__upgrade_compatibility_tests__addresses_first.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,13 @@ | ||
--- | ||
source: crates/sui/src/unit_tests/upgrade_compatibility_tests.rs | ||
expression: output | ||
--- | ||
error[Compatibility E01007]: module missing | ||
┌─ /Users/jordanjennings/code/sui/crates/sui/src/unit_tests/fixtures/upgrade_errors/missing_module_toml/addresses_first/Move.toml:4:1 | ||
│ | ||
4 │ ╭ [package] | ||
5 │ │ name = "upgrades" | ||
│ ╰─────────────────^ Package is missing module 'identifier' | ||
│ | ||
= Modules which are part package cannot be removed during an upgrade. | ||
= add missing module 'identifier' back to the package. |
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
15 changes: 15 additions & 0 deletions
15
.../unit_tests/snapshots/sui__upgrade_compatibility__upgrade_compatibility_tests__emoji.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,15 @@ | ||
--- | ||
source: crates/sui/src/unit_tests/upgrade_compatibility_tests.rs | ||
expression: output | ||
--- | ||
error[Compatibility E01007]: module missing | ||
┌─ /Users/jordanjennings/code/sui/crates/sui/src/unit_tests/fixtures/upgrade_errors/missing_module_toml/emoji/Move.toml:2:2 | ||
│ | ||
2 │ 😀[package]😀 | ||
│ ╭───^ | ||
3 │ │ 😀 | ||
4 │ │ 😀name = "emoji"😀 | ||
│ ╰──────────────────^ Package is missing module 'identifier' | ||
│ | ||
= Modules which are part package cannot be removed during an upgrade. | ||
= add missing module 'identifier' back to the package. |
12 changes: 12 additions & 0 deletions
12
.../unit_tests/snapshots/sui__upgrade_compatibility__upgrade_compatibility_tests__empty.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,12 @@ | ||
--- | ||
source: crates/sui/src/unit_tests/upgrade_compatibility_tests.rs | ||
expression: output | ||
--- | ||
error[Compatibility E01007]: module missing | ||
┌─ /Users/jordanjennings/code/sui/crates/sui/src/unit_tests/fixtures/upgrade_errors/missing_module_toml/empty/Move.toml:1:1 | ||
│ | ||
1 │ | ||
│ ^ Package is missing module 'identifier' | ||
│ | ||
= Modules which are part package cannot be removed during an upgrade. | ||
= add missing module 'identifier' back to the package. |
12 changes: 12 additions & 0 deletions
12
...s/snapshots/sui__upgrade_compatibility__upgrade_compatibility_tests__package_no_name.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,12 @@ | ||
--- | ||
source: crates/sui/src/unit_tests/upgrade_compatibility_tests.rs | ||
expression: output | ||
--- | ||
error[Compatibility E01007]: module missing | ||
┌─ /Users/jordanjennings/code/sui/crates/sui/src/unit_tests/fixtures/upgrade_errors/missing_module_toml/package_no_name/Move.toml:1:1 | ||
│ | ||
1 │ [package] | ||
│ ^^^^^^^^^ Package is missing module 'identifier' | ||
│ | ||
= Modules which are part package cannot be removed during an upgrade. | ||
= add missing module 'identifier' back to the package. |
14 changes: 14 additions & 0 deletions
14
...napshots/sui__upgrade_compatibility__upgrade_compatibility_tests__starts_second_line.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,14 @@ | ||
--- | ||
source: crates/sui/src/unit_tests/upgrade_compatibility_tests.rs | ||
expression: output | ||
--- | ||
error[Compatibility E01007]: module missing | ||
┌─ /Users/jordanjennings/code/sui/crates/sui/src/unit_tests/fixtures/upgrade_errors/missing_module_toml/starts_second_line/Move.toml:2:1 | ||
│ | ||
2 │ ╭ [package] | ||
3 │ │ name = "upgrades" | ||
4 │ │ edition = "2024.beta" # edition = "legacy" to use legacy (pre-2024) Move | ||
│ ╰────────────────────────────────────────────────────────────────────────^ Package is missing module 'identifier' | ||
│ | ||
= Modules which are part package cannot be removed during an upgrade. | ||
= add missing module 'identifier' back to the package. |
13 changes: 13 additions & 0 deletions
13
..._tests/snapshots/sui__upgrade_compatibility__upgrade_compatibility_tests__whitespace.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,13 @@ | ||
--- | ||
source: crates/sui/src/unit_tests/upgrade_compatibility_tests.rs | ||
expression: output | ||
--- | ||
error[Compatibility E01007]: module missing | ||
┌─ /Users/jordanjennings/code/sui/crates/sui/src/unit_tests/fixtures/upgrade_errors/missing_module_toml/whitespace/Move.toml:1:1 | ||
│ | ||
1 │ ╭ | ||
2 │ │ | ||
│ ╰──^ Package is missing module 'identifier' | ||
│ | ||
= Modules which are part package cannot be removed during an upgrade. | ||
= add missing module 'identifier' back to the package. |
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.