Skip to content

Commit

Permalink
use one error struct
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjennings-mysten committed Dec 19, 2024
1 parent c5b49cf commit 108a4e4
Show file tree
Hide file tree
Showing 11 changed files with 478 additions and 458 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
source: crates/sui/src/unit_tests/upgrade_compatibility_tests.rs
expression: normalize_path(err.to_string())
---
error[Compatibility E01005]: missing declaration
error[Compatibility E01007]: missing declaration
┌─ /fixtures/upgrade_errors/additive_errors_v2/sources/UpgradeErrors.move:4:18
4module upgrades::upgrades {
^^^^^^^^ enum 'EnumToRemove' is missing
= enums cannot be changed or removed during an 'additive' or 'dependency only' upgrade.
= enums cannot be removed or changed during an 'additive' or 'dependency only' upgrade.
= add missing enum 'EnumToRemove' back to the module 'upgrades'.

error[Compatibility E01005]: missing declaration
error[Compatibility E01007]: missing declaration
┌─ /fixtures/upgrade_errors/additive_errors_v2/sources/UpgradeErrors.move:4:18
4module upgrades::upgrades {
^^^^^^^^ function 'function_to_remove' is missing
= functions cannot be changed or removed during an 'additive' or 'dependency only' upgrade.
= functions cannot be removed or changed during an 'additive' or 'dependency only' upgrade.
= add missing function 'function_to_remove' back to the module 'upgrades'.

error[Compatibility E01005]: missing declaration
error[Compatibility E01007]: missing declaration
┌─ /fixtures/upgrade_errors/additive_errors_v2/sources/UpgradeErrors.move:4:18
4 │ module upgrades::upgrades {
^^^^^^^^ struct 'StructToRemove' is missing
= structs cannot be changed or removed during an 'additive' or 'dependency only' upgrade.
= structs cannot be removed or changed during an 'additive' or 'dependency only' upgrade.
= add missing struct 'StructToRemove' back to the module 'upgrades'.

error[Compatibility E01002]: type mismatch
Expand All @@ -37,7 +37,7 @@ error[Compatibility E01002]: type mismatch
7 │ new_field: u32 // changed to u32
│ ^^^^^^^^^ Mismatched field type 'u32', expected 'u64'.
= Structs are part of a module's public interface and cannot be changed during an upgrade.
= Structs cannot be changed during an 'additive' or 'dependency only' upgrade.
= Restore the original struct's field for struct 'StructToChange' including the ordering.

error[Compatibility E03001]: function signature mismatch
Expand All @@ -46,8 +46,8 @@ error[Compatibility E03001]: function signature mismatch
18 │ fun function_to_change(): u32 { // changed to u32
^^^ Unexpected return type u32, expected u64
= Functions are part of a module's public interface and cannot be changed during an upgrade.
= Functions cannot be removed or changed during an 'additive' or 'dependency only' upgrade.
= Restore the original function's return type for function 'function_to_change'.


Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'Compatible'.
Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'additive'.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ error[Compatibility E01001]: missing public declaration
6module upgrades::upgrades {
^^^^^^^^ enum 'EnumToBeRemoved' is missing
= enums are part of a module's public interface and cannot be removed or changed during an upgrade.
= enums are part of a module's public interface and cannot be removed or changed during a 'compatible' upgrade.
= add missing enum 'EnumToBeRemoved' back to the module 'upgrades'.

error[Compatibility E01001]: missing public declaration
Expand All @@ -17,7 +17,7 @@ error[Compatibility E01001]: missing public declaration
6module upgrades::upgrades {
^^^^^^^^ struct 'StructToBeRemoved' is missing
= structs are part of a module's public interface and cannot be removed or changed during an upgrade.
= structs are part of a module's public interface and cannot be removed or changed during a 'compatible' upgrade.
= add missing struct 'StructToBeRemoved' back to the module 'upgrades'.

error[Compatibility E01003]: ability mismatch
Expand All @@ -26,7 +26,7 @@ error[Compatibility E01003]: ability mismatch
11public struct StructAbilityMismatchAdd has copy {} // added the copy ability where none existed
^^^^^^^^^^^^^^^^^^^^^^^^ Unexpected ability: 'copy'
= Structs are part of a module's public interface and cannot be changed during an upgrade.
= Structs are part of a module's public interface and cannot be removed or changed during a 'compatible' upgrade.
= Restore the original abilities of struct 'StructAbilityMismatchAdd': none.

error[Compatibility E01003]: ability mismatch
Expand All @@ -35,7 +35,7 @@ error[Compatibility E01003]: ability mismatch
14public struct StructAbilityMismatchRemove {} // removed the copy ability
^^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing ability: 'copy'
= Structs are part of a module's public interface and cannot be changed during an upgrade.
= Structs are part of a module's public interface and cannot be removed or changed during a 'compatible' upgrade.
= Restore the original ability of struct 'StructAbilityMismatchRemove': 'copy'.

error[Compatibility E01003]: ability mismatch
Expand All @@ -44,10 +44,10 @@ error[Compatibility E01003]: ability mismatch
17public struct StructAbilityMismatchChange has drop {} // changed from drop to copy
^^^^^^^^^^^^^^^^^^^^^^^^^^^ Mismatched abilities: missing 'copy', unexpected 'drop'
= Structs are part of a module's public interface and cannot be changed during an upgrade.
= Structs are part of a module's public interface and cannot be removed or changed during a 'compatible' upgrade.
= Restore the original ability of struct 'StructAbilityMismatchChange': 'copy'.

error[Compatibility E01006]: type parameter mismatch
error[Compatibility E01005]: type parameter mismatch
┌─ /fixtures/upgrade_errors/all_v2/sources/UpgradeErrors.move:20:19
20public struct StructTypeParamMismatch<T> { a: T } // changed S to T
Expand Down Expand Up @@ -92,7 +92,7 @@ error[Compatibility E01003]: ability mismatch
45 │ public enum EnumAbilityMismatchAdd has copy {
│ ^^^^^^^^^^^^^^^^^^^^^^ Unexpected ability: 'copy'
= Enums are part of a module's public interface and cannot be changed during an upgrade.
= Enums are part of a module's public interface and cannot be changed during a 'compatible' upgrade.
= Restore the original abilities of the enum: none for enum 'EnumAbilityMismatchAdd'.

error[Compatibility E01003]: ability mismatch
Expand All @@ -101,7 +101,7 @@ error[Compatibility E01003]: ability mismatch
50 │ public enum EnumAbilityMismatchRemove {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ Missing ability: 'copy'
= Enums are part of a module's public interface and cannot be changed during an upgrade.
= Enums are part of a module's public interface and cannot be changed during a 'compatible' upgrade.
= Restore the original ability of the enum: 'copy' for enum 'EnumAbilityMismatchRemove'.

error[Compatibility E01003]: ability mismatch
Expand All @@ -110,7 +110,7 @@ error[Compatibility E01003]: ability mismatch
55 │ public enum EnumAbilityMismatchChange has drop {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^ Mismatched abilities: missing 'copy', unexpected 'drop'
= Enums are part of a module's public interface and cannot be changed during an upgrade.
= Enums are part of a module's public interface and cannot be changed during a 'compatible' upgrade.
= Restore the original ability of the enum: 'copy' for enum 'EnumAbilityMismatchChange'.

error[Compatibility E02001]: variant mismatch
Expand Down Expand Up @@ -149,7 +149,7 @@ error[Compatibility E03001]: function signature mismatch
82 │ public fun function_add_arg(a: u64) {}
│ ^^^^^^^^^^^^^^^^ Expected 0 parameters, found 1
= Functions are part of a module's public interface and cannot be changed during an upgrade.
= Functions are part of a module's public interface and cannot be removed or changed during an 'compatible' upgrade.
= Restore the original function's parameters for function 'function_add_arg', expected 0 parameters.

error[Compatibility E03001]: function signature mismatch
Expand All @@ -158,7 +158,7 @@ error[Compatibility E03001]: function signature mismatch
85 │ public fun function_remove_arg() {}
│ ^^^^^^^^^^^^^^^^^^^ Expected 1 parameter, found 0
= Functions are part of a module's public interface and cannot be changed during an upgrade.
= Functions are part of a module's public interface and cannot be removed or changed during an 'compatible' upgrade.
= Restore the original function's parameter for function 'function_remove_arg', expected 1 parameter.

error[Compatibility E03001]: function signature mismatch
Expand All @@ -167,8 +167,8 @@ error[Compatibility E03001]: function signature mismatch
88 │ public fun function_change_arg(a: u8) {} // now has u8 instead of u64
│ ^ Unexpected parameter u8, expected u64
= Functions are part of a module's public interface and cannot be changed during an upgrade.
= Functions are part of a module's public interface and cannot be removed or changed during an 'compatible' upgrade.
= Restore the original function's parameter for function 'function_change_arg'.


Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'Compatible'.
Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'compatible'.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ error[Compatibility E01001]: missing public declaration
4module upgrades::enum_ {
^^^^^ enum 'EnumToBeRemoved' is missing
= enums are part of a module's public interface and cannot be removed or changed during an upgrade.
= enums are part of a module's public interface and cannot be removed or changed during a 'compatible' upgrade.
= add missing enum 'EnumToBeRemoved' back to the module 'enum_'.

error[Compatibility E01001]: missing public declaration
Expand All @@ -17,8 +17,8 @@ error[Compatibility E01001]: missing public declaration
4module upgrades::func_ {
^^^^^ public function 'fun_to_be_removed' is missing
= functions are part of a module's public interface and cannot be removed or changed during an upgrade.
= add missing function 'fun_to_be_removed' back to the module 'func_'.
= public functions are part of a module's public interface and cannot be removed or changed during a 'compatible' upgrade.
= add missing public function 'fun_to_be_removed' back to the module 'func_'.

error[Compatibility E01001]: missing public declaration
┌─ /fixtures/upgrade_errors/declaration_errors_v2/sources/func.move:7:9
Expand All @@ -35,8 +35,8 @@ error[Compatibility E01001]: missing public declaration
4 │ module upgrades::struct_ {
^^^^^^^ struct 'StructToBeRemoved' is missing
= structs are part of a module's public interface and cannot be removed or changed during an upgrade.
= structs are part of a module's public interface and cannot be removed or changed during a 'compatible' upgrade.
= add missing struct 'StructToBeRemoved' back to the module 'struct_'.


Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'Compatible'.
Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'compatible'.
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ error[Compatibility E03001]: function signature mismatch
= Restore the original function 'new_function' including the ordering.


Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'Compatible'.
Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'dep_only'.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ error[Compatibility E01003]: ability mismatch
9public enum EnumAddAbility has copy, drop { // add drop
│ ^^^^^^^^^^^^^^ Unexpected ability: 'drop'
= Enums are part of a module's public interface and cannot be changed during an upgrade.
= Enums are part of a module's public interface and cannot be changed during a 'compatible' upgrade.
= Restore the original ability of the enum: 'copy' for enum 'EnumAddAbility'.

error[Compatibility E01003]: ability mismatch
Expand All @@ -17,7 +17,7 @@ error[Compatibility E01003]: ability mismatch
13 │ public enum EnumRemoveAbility has copy { // drop removed
│ ^^^^^^^^^^^^^^^^^ Missing ability: 'drop'
= Enums are part of a module's public interface and cannot be changed during an upgrade.
= Enums are part of a module's public interface and cannot be changed during a 'compatible' upgrade.
= Restore the original abilities of the enum: 'copy' and 'drop' for enum 'EnumRemoveAbility'.

error[Compatibility E01003]: ability mismatch
Expand All @@ -26,7 +26,7 @@ error[Compatibility E01003]: ability mismatch
17 │ public enum EnumAddAndRemoveAbility has copy, store {
│ ^^^^^^^^^^^^^^^^^^^^^^^ Mismatched abilities: missing 'drop', unexpected 'store'
= Enums are part of a module's public interface and cannot be changed during an upgrade.
= Enums are part of a module's public interface and cannot be changed during a 'compatible' upgrade.
= Restore the original abilities of the enum: 'copy' and 'drop' for enum 'EnumAddAndRemoveAbility'.

error[Compatibility E02001]: variant mismatch
Expand Down Expand Up @@ -125,7 +125,7 @@ error[Compatibility E01003]: ability mismatch
49 │ public enum EnumAddAbilityWithTypes has copy, drop { // drop added
│ ^^^^^^^^^^^^^^^^^^^^^^^ Unexpected ability: 'drop'
= Enums are part of a module's public interface and cannot be changed during an upgrade.
= Enums are part of a module's public interface and cannot be changed during a 'compatible' upgrade.
= Restore the original ability of the enum: 'copy' for enum 'EnumAddAbilityWithTypes'.

error[Compatibility E01003]: ability mismatch
Expand All @@ -134,7 +134,7 @@ error[Compatibility E01003]: ability mismatch
53 │ public enum EnumRemoveAbilityWithTypes has copy { // drop removed
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Missing ability: 'drop'
= Enums are part of a module's public interface and cannot be changed during an upgrade.
= Enums are part of a module's public interface and cannot be changed during a 'compatible' upgrade.
= Restore the original abilities of the enum: 'copy' and 'drop' for enum 'EnumRemoveAbilityWithTypes'.

error[Compatibility E02001]: variant mismatch
Expand Down Expand Up @@ -207,4 +207,4 @@ error[Compatibility E02001]: variant mismatch
= Restore the original enum's variants for enum 'EnumChangeAndAddVariantWithTypes' including the ordering.


Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'Compatible'.
Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'compatible'.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ error[Compatibility E03001]: function signature mismatch
9 │ public fun func_with_wrong_param(a: u32): u64 {
^ Unexpected parameter u32, expected u64
= Functions are part of a module's public interface and cannot be changed during an upgrade.
= Functions are part of a module's public interface and cannot be removed or changed during an 'compatible' upgrade.
= Restore the original function's parameter for function 'func_with_wrong_param'.

error[Compatibility E03001]: function signature mismatch
Expand All @@ -17,7 +17,7 @@ error[Compatibility E03001]: function signature mismatch
14 │ public fun func_with_wrong_return(): u32 {
^^^ Unexpected return type u32, expected u64
= Functions are part of a module's public interface and cannot be changed during an upgrade.
= Functions are part of a module's public interface and cannot be removed or changed during an 'compatible' upgrade.
= Restore the original function's return type for function 'func_with_wrong_return'.

error[Compatibility E03001]: function signature mismatch
Expand All @@ -26,7 +26,7 @@ error[Compatibility E03001]: function signature mismatch
19 │ public fun func_with_wrong_param_and_return(a: u32): u32 {
^ Unexpected parameter u32, expected u64
= Functions are part of a module's public interface and cannot be changed during an upgrade.
= Functions are part of a module's public interface and cannot be removed or changed during an 'compatible' upgrade.
= Restore the original function's parameter for function 'func_with_wrong_param_and_return'.

error[Compatibility E03001]: function signature mismatch
Expand All @@ -35,7 +35,7 @@ error[Compatibility E03001]: function signature mismatch
19 │ public fun func_with_wrong_param_and_return(a: u32): u32 {
^^^ Unexpected return type u32, expected u64
= Functions are part of a module's public interface and cannot be changed during an upgrade.
= Functions are part of a module's public interface and cannot be removed or changed during an 'compatible' upgrade.
= Restore the original function's return type for function 'func_with_wrong_param_and_return'.

error[Compatibility E03001]: function signature mismatch
Expand All @@ -44,7 +44,7 @@ error[Compatibility E03001]: function signature mismatch
24 │ public fun func_with_wrong_param_length(a: u64): u64 {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected 2 parameters, found 1
= Functions are part of a module's public interface and cannot be changed during an upgrade.
= Functions are part of a module's public interface and cannot be removed or changed during an 'compatible' upgrade.
= Restore the original function's parameters for function 'func_with_wrong_param_length', expected 2 parameters.

error[Compatibility E03001]: function signature mismatch
Expand All @@ -53,8 +53,8 @@ error[Compatibility E03001]: function signature mismatch
29 │ public fun func_with_wrong_return_length(): u64 {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected 2 return types, found 1
= Functions are part of a module's public interface and cannot be changed during an upgrade.
= Functions are part of a module's public interface and cannot be removed or changed during an 'compatible' upgrade.
= Restore the original function's return types for function 'func_with_wrong_return_length'.


Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'Compatible'.
Upgrade failed, this package requires changes to be compatible with the existing package. Its upgrade policy is set to 'compatible'.
Loading

0 comments on commit 108a4e4

Please sign in to comment.