-
Notifications
You must be signed in to change notification settings - Fork 741
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
encodeType
of typed data does not encode preset types correctly
#1002
Comments
Note that in the current code, following the SNIP notation, encode_type is treated as a simple type but encoding is applied as for a custom type/object. @sgc-code Could you confirm that encode_type should be applied the same as for a custom type? I recall being conflicted about this while working on #920 since either approach is essentially a constant but it seems I didn't remember to explicitly ask about it. |
🎉 This issue has been resolved in version 6.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 7.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Describe the bug
encodeType
of type data does not encode preset types correctly.You can verify this from the SNIP:
Where for every preset type, it says:
And per the X is an object, every object should encoded as follows:
The spec also refers to this repo for examples, where preset type
u256
is included along with its properties.To Reproduce
Run this test:
starknet.js/__tests__/utils/typedData.test.ts
Line 50 in fdcc7fb
Expected behavior
All preset types are encoded as objects:
Actual behavior
All preset types are encoded as basic types:
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: