Add disableAscii
option for toHuman, and toPrimitive
#5831
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My attempt at resolving the upstream issue in apps: polkadot-js/apps#10343
This adds the
disableAscii
option to thetoHuman
andtoPrimitive
property on Codec types. The problem came up when the UI was trying to decode the chainState forbroker.regions
in rococo coretime parachain. The typePalletBrokerCoreMask
inside ofPalletBrokerRegionId
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 theRaw
base type.