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

fix: Revert: Add serialization traits to Status #530

Closed
wants to merge 1 commit into from

Conversation

ericswanson-dfinity
Copy link
Member

@ericswanson-dfinity ericswanson-dfinity commented Mar 12, 2024

Description

This is a breaking change.

#499 added the CandidType, Serialize, and Deserialized traits to Status, in support of dfx ping to output json.

However, Status isn't really appropriate for any of these. The values map contains every field in the status. But the other fields are populated during cbor deserialization. It's true that technically, you could serialize a Status and then deserialize it, even to and from candid. But when formatted to json, with the default serializer, a Status might look like this:

{
  "impl_hash": "a380266e4b6977b7cce447aa5f784efdba0bb45820d51f39b9e7908f7fbb1aa1",
  "replica_health_status": "healthy",
  "root_key": [ 48, 129, 130 ],
  "values": {
    "certified_height": {
      "Integer": 948674
    },
    "ic_api_version": {
      "String": "0.18.0"
    },
    "impl_hash": {
      "String": "a380266e4b6977b7cce447aa5f784efdba0bb45820d51f39b9e7908f7fbb1aa1"
    },
    "impl_version": {
      "String": "0.9.0"
    },
    "replica_health_status": {
      "String": "healthy"
    },
    "root_key": {
      "Bytes": [
        48,
        129,
        130
      ]
    }
  }
}

This reverts commit f216c74(#499). We'll address the output of dfx ping in another way.

How Has This Been Tested?

The reversion removed the related test.

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@ericswanson-dfinity ericswanson-dfinity requested a review from a team as a code owner March 12, 2024 22:51
@ericswanson-dfinity ericswanson-dfinity changed the title Revert "feat: Add serialization traits to Status (#499)" fix: Revert "feat: Add serialization traits to Status (#499)" Mar 12, 2024
@ericswanson-dfinity ericswanson-dfinity changed the title fix: Revert "feat: Add serialization traits to Status (#499)" fix: Revert: Add serialization traits to Status Mar 12, 2024
@ericswanson-dfinity
Copy link
Member Author

Replaced by #533 because this branch/PR isn't picking up new commits

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.

1 participant