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: decode Bytes types for /runtime/metadata correctly #907

Merged
merged 22 commits into from
Apr 29, 2022

Conversation

TarikGul
Copy link
Member

closes: #893

There are certain values given via the metadata that exist as type Bytes or Raw. Since technically the bytes can be any value, we need to find the lookup type definitions and then sanitize them accordingly. To do this I added an options param to sanitizeNumbers which allows us to specify we are sanitizing metadata, and to pass in a registry in order to correctly build the corresponding types these Bytes point to then decode them to a correct (a.) JSON value (b.) correct integer.

@TarikGul TarikGul requested a review from a team as a code owner April 25, 2022 20:58
@TarikGul TarikGul changed the title Tarik metadata decode fix: decode Bytes types for /runtime/metadata correctly Apr 25, 2022
Copy link
Contributor

@CurlyBracketEffect CurlyBracketEffect left a comment

Choose a reason for hiding this comment

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

LGTM

@TarikGul TarikGul requested review from a team and removed request for a team April 26, 2022 14:37
jsdw
jsdw approved these changes Apr 28, 2022
@TarikGul
Copy link
Member Author

Before we merge I am actually going to switch the structure up a bit to accommodate different metadata versions.

@TarikGul TarikGul merged commit ce48c14 into master Apr 29, 2022
@TarikGul TarikGul deleted the tarik-metadata-decode branch April 29, 2022 20:33
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.

Decode hex values returned from /runtime/metadata
3 participants