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

Add disableAscii option for toHuman, and toPrimitive #5831

Merged
merged 7 commits into from
Mar 21, 2024

Conversation

TarikGul
Copy link
Member

@TarikGul TarikGul commented Mar 20, 2024

My attempt at resolving the upstream issue in apps: polkadot-js/apps#10343

This adds the disableAscii option to the toHuman and toPrimitive property on Codec types. The problem came up when the UI was trying to decode the chainState for broker.regions in rococo coretime parachain. The type PalletBrokerCoreMask inside of PalletBrokerRegionId had the following bytes [85, 85, 85, 85, 85, 85, 85, 85, 85, 85] which can be also interpreted as valid ASCII, and when passed through the Raw types toHuman it converts the following to ASCII which should not be the case. Instead a hex value here makes more sense.

So the solution was to add disableAscii which should now work for any Codec type that might include a sub value that is interpreted to the Raw base type.

@TarikGul TarikGul changed the title Add allowAscii option for toHuman, and toPrimitive [WIP] Add disableAscii option for toHuman, and toPrimitive [WIP] Mar 20, 2024
@TarikGul TarikGul changed the title Add disableAscii option for toHuman, and toPrimitive [WIP] Add disableAscii option for toHuman, and toPrimitive Mar 21, 2024
@TarikGul TarikGul added the -auto label Mar 21, 2024
@polkadot-js-bot polkadot-js-bot merged commit 0982f68 into master Mar 21, 2024
6 checks passed
@polkadot-js-bot polkadot-js-bot deleted the tg-allowAscii branch March 21, 2024 17:17
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Mar 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants