Skip to content
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

Upgrade Errors for struct enum functions #20151

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jordanjennings-mysten
Copy link
Contributor

@jordanjennings-mysten jordanjennings-mysten commented Nov 2, 2024

Description

Add struct, enum and function errors to upgrade errors, leaves out type params to give it, it's own PR.

Test plan

snapshots


Release notes

no effect until enabled

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:

Copy link

vercel bot commented Nov 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 4, 2024 7:42pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Nov 4, 2024 7:42pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Nov 4, 2024 7:42pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Nov 4, 2024 7:42pm

@@ -15,6 +15,7 @@ pub mod key_identity;
pub mod keytool;
pub mod shell;
pub mod sui_commands;
mod upgrade_compatibility;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this change do?

= Enums are part of a module's public interface and cannot be changed during an upgrade
= Restore the original enum's variants for enum 'EnumChangeVariant' including the ordering.

error[Compatibility E01002]: type mismatch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really a "type mismatch"?

59 │ B { b: u8 }, // added
│ ^^^^^^^^^^^ New unexpected variant 'B'.
= Enums are part of a module's public interface and cannot be changed during an upgrade.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing some weird characters at the end of these lines on GitHub. Any idea what is up here?

Vec::<(Loc, String)>::new(),
vec![
"Functions are part of a module's public interface and cannot be changed during an upgrade.".to_string(),
format!("Restore the original function's parameters for function '{function_name}', expected {} parameters.", old_function.parameters.len())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to do some manual line breaks in the string here for some manual formatting, e.g.

Suggested change
format!("Restore the original function's parameters for function '{function_name}', expected {} parameters.", old_function.parameters.len())
format!("Restore the original function's parameters for \
function '{function_name}', expected {} parameters.", old_function.parameters.len())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants