-
Notifications
You must be signed in to change notification settings - Fork 40
feat!(ServiceProviderRegistry): Hex Capabilities #816
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
base: pdpv0
Are you sure you want to change the base?
Conversation
|
What about the decode? It seems to me that UI might try displaying garbage or messing (UTF normalisation) with it, resulting in the capability getting corrupted on a round-trip. |
This is a good point. Indeed it is hard to know the types of additional fields. Etherscan handles this by showing untyped data in hex by default and providing buttons for the user to decode it via utf8 or bigendian. Let me know what you think! |
|
The issue is as follows:
I think the simplest way to avoid this, is to keep raw bytes of unedited keys. |
|
ok, approved without reading the full thread, good points
how do you propose to do this? we'd need to plumb through an "edited" status which complicates the UI somewhat how about just using |
|
Or here's an alternative - do it in the UI, pass all of the capabilities to the UI (whatever's easiest to get a Uint8Array into the browser using the stack Curio uses to pass that), then do a round-trip in the browser using |
|
I don't think any certs will be printable because they have zero-bytes which decode into the null terminator. |
Reviewer @rvagg
This allows the user to enter a hex string prefixed with
0xand it will be encoded as bytes.Hex encoding is good for:
We can consider detecting and supporting other encodings.
Changes
If a capability value string is hex, encode the bytes directly rather than as utf8