-
Notifications
You must be signed in to change notification settings - Fork 10
Decoding raw ByteString TokenNames #50
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
Conversation
…e into gergely/raw-bytestring-tokennames
|
Bit confused over the cli logic here - does it just add a |
Co-authored-by: Samuel Williams <33094920+samuelWilliams99@users.noreply.github.com>
|
@samuelWilliams99 Couldn't find any documentation about this, but it seems like that is the case: if the token name is not a utf8 encoded string, then an 0x will be added to it. But maybe @t4ccer knows more about it, he bumped into this issue. I spent some time to track down where the |
…e into gergely/raw-bytestring-tokennames
|
How odd, yeah there doesn't appear to be any logic adding that - even the serialisation instance for AssetName is just |
In a project where we use bot-plutus-interface, we use a non utf8 tokenname (it is a hash of a few things), so the current implementation would fail.
It turned out that we don't need to explicitly decode the tokenname from hex to a utf8 ByteString, it can be decoded straight into bs and it would still be interpreted the same way inside the Plutus code.
The cli adds a 0x prefix for raw bytestring tokennames, but we can simply skip over that.