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: backwards-compatible ctype data decoding #703

Merged
merged 6 commits into from
Jan 30, 2023

Conversation

rflechtner
Copy link
Contributor

@rflechtner rflechtner commented Jan 25, 2023

Makes sure the sdk still decodes CType records from before the chain upgrade to 0.9.0 / 0.8.5.
Adjust tests so that CType fetching is skipped where not available.

How to test:

We should no longer see the Invalid empty address passed errors in integration tests against latest (e.g., https://github.com/KILTprotocol/sdk-js/actions/runs/4003744234/jobs/6872161008).
Fetching CType data will still fail with Cannot fetch CType definitions on a chain that does not store the createdAt block.

Checklist:

  • I have verified that the code works
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • I have left the code in a better state
  • I have documented the changes (where applicable)

@rflechtner rflechtner marked this pull request as ready for review January 25, 2023 19:35
@rflechtner rflechtner requested a review from ntn-x2 January 25, 2023 20:15
Copy link
Member

@ntn-x2 ntn-x2 left a comment

Choose a reason for hiding this comment

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

LGTM! The only thing that's not 100% clear is why we don't use the storage version number, that we decided to be 2 for the valid storage structure.

packages/core/src/__integrationtests__/Ctypes.spec.ts Outdated Show resolved Hide resolved
packages/core/src/__integrationtests__/Ctypes.spec.ts Outdated Show resolved Hide resolved
@rflechtner rflechtner merged commit 11f46e3 into develop Jan 30, 2023
@rflechtner rflechtner deleted the rf-ctype-backwards-compatibility branch January 30, 2023 17:01
@rflechtner rflechtner changed the title feat: backwards-compatible ctype data decoding fix: backwards-compatible ctype data decoding Feb 3, 2023
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