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 formatting positional fields, nested fields, named fields on enums #20653

Conversation

jordanjennings-mysten
Copy link
Contributor

@jordanjennings-mysten jordanjennings-mysten commented Dec 17, 2024

Description

Adds tests and formatting fixes for:

  • positional fields on structs and enums
  • more cases for named fields on enums
  • positional struct nested in struct
  • positional struct nested in enum

Test plan

How did you test the new or updated feature?

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):
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

Copy link

vercel bot commented Dec 17, 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 Dec 20, 2024 9:36pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2024 9:36pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2024 9:36pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2024 9:36pm

@jordanjennings-mysten jordanjennings-mysten temporarily deployed to sui-typescript-aws-kms-test-env December 17, 2024 01:03 — with GitHub Actions Inactive
@jordanjennings-mysten jordanjennings-mysten changed the title pull out field error formatting, generalize to positional fields, handle named fields on enums upgrade errors formatting positional fields, nested fields, named fields on enums Dec 17, 2024
@jordanjennings-mysten jordanjennings-mysten temporarily deployed to sui-typescript-aws-kms-test-env December 17, 2024 01:26 — with GitHub Actions Inactive
Copy link
Contributor

@stefan-mysten stefan-mysten left a comment

Choose a reason for hiding this comment

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

Nice work! This looks reasonable to me.

crates/sui/src/upgrade_compatibility.rs Outdated Show resolved Hide resolved
crates/sui/src/upgrade_compatibility.rs Outdated Show resolved Hide resolved
crates/sui/src/upgrade_compatibility.rs Show resolved Hide resolved
crates/sui/src/upgrade_compatibility.rs Show resolved Hide resolved
crates/sui/src/upgrade_compatibility.rs Show resolved Hide resolved
crates/sui/src/upgrade_compatibility.rs Show resolved Hide resolved
return (
Declarations::FieldMismatch.into(),
vec![format!(
"Mismatched variant field count, expected {}, found {}.",
Copy link
Contributor

Choose a reason for hiding this comment

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

nit (ignore if not relevant): most places we do message {}, expected {}. Here it is reversed: expected, found.

crates/sui/src/upgrade_compatibility.rs Show resolved Hide resolved
@jordanjennings-mysten jordanjennings-mysten temporarily deployed to sui-typescript-aws-kms-test-env December 20, 2024 21:31 — with GitHub Actions Inactive
@jordanjennings-mysten jordanjennings-mysten temporarily deployed to sui-typescript-aws-kms-test-env December 20, 2024 21:35 — with GitHub Actions Inactive
@jordanjennings-mysten jordanjennings-mysten merged commit a8b3ad3 into MystenLabs:main Dec 20, 2024
49 of 50 checks passed
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