-
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.
Upgrade error formatting: missing from module (#19795)
## Description Add formatting to missing from module errors from upgrades. When a struct, enum, or function is missing from a module the relevant module definition is shown along with the specifics of what was missing. ## Test plan Snapshot testing --- ## 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
7e01df8
commit 482bc5b
Showing
15 changed files
with
234 additions
and
87 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
File renamed without changes.
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
File renamed without changes.
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
23 changes: 0 additions & 23 deletions
23
...it_tests/snapshots/sui__upgrade_compatibility__upgrade_compatibility_tests__all_fail.snap
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
...pshots/sui__upgrade_compatibility__upgrade_compatibility_tests__declarations_missing.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,30 @@ | ||
--- | ||
source: crates/sui/src/unit_tests/upgrade_compatibility_tests.rs | ||
expression: normalize_path(err.to_string()) | ||
--- | ||
error: struct is missing | ||
┌─ /fixtures/upgrade_errors/declarations_missing_v2/sources/UpgradeErrors.move:7:18 | ||
│ | ||
7 │ module upgrades::upgrades { | ||
│ ^^^^^^^^ Module 'upgrades' expected struct 'StructToBeRemoved', but found none | ||
│ | ||
= structs are part of a module's public interface and cannot be removed or changed during an upgrade, add back the struct 'StructToBeRemoved'. | ||
|
||
error: enum is missing | ||
┌─ /fixtures/upgrade_errors/declarations_missing_v2/sources/UpgradeErrors.move:7:18 | ||
│ | ||
7 │ module upgrades::upgrades { | ||
│ ^^^^^^^^ Module 'upgrades' expected enum 'EnumToBeRemoved', but found none | ||
│ | ||
= enums are part of a module's public interface and cannot be removed or changed during an upgrade, add back the enum 'EnumToBeRemoved'. | ||
|
||
error: public function is missing | ||
┌─ /fixtures/upgrade_errors/declarations_missing_v2/sources/UpgradeErrors.move:7:18 | ||
│ | ||
7 │ module upgrades::upgrades { | ||
│ ^^^^^^^^ Module 'upgrades' expected public function 'fun_to_be_removed', but found none | ||
│ | ||
= public functions are part of a module's public interface and cannot be removed or changed during an upgrade, add back the public function 'fun_to_be_removed'. | ||
|
||
|
||
Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'Compatible'. |
6 changes: 0 additions & 6 deletions
6
...ts/snapshots/sui__upgrade_compatibility__upgrade_compatibility_tests__struct_missing.snap
This file was deleted.
Oops, something went wrong.
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.