-
Notifications
You must be signed in to change notification settings - Fork 479
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
Cannot compare TokenName in Validator #3254
Comments
I'm generally having a hard time comparing variants of string
|
This error happens because
The error happens here because there is no instance
Yeah, |
I have ...
and later ... This gives me ... Could you perhaps show me how to construct a TokenName from a String and an Integer and then compare that to the TokenName that the caller provided? The code is here ... |
So it should be:
It's not possible yet unfortunately. There is no way to transform integer into You may try to declare a pair |
Thanks. Could I perhaps extract the Integer suffix from the caller provided TokenName? For example, everything after the first five bytes should |
Well, there is |
I have a I would either need to turn the TokenName suffix into an Integer and compare the two Integers or the Integer that I have into a BytesString and then compare those. From what we said above, it is not (yet) possible construct a TokenName from a String prefix plus Integer - like this How would you validate the given TokenName? |
Again, it's not possible to convert You can take the suffix and parse it for example:
|
merci |
Area
[] Plutus Foundation Related to the GHC plugin, Haskell-to-Plutus compiler, on-chain code
Summary
Simple equality of a token name does not compile
System info (please complete the following information):
The text was updated successfully, but these errors were encountered: