-
Notifications
You must be signed in to change notification settings - Fork 818
Cairotypes/all #1496
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: develop
Are you sure you want to change the base?
Cairotypes/all #1496
Conversation
…31, CairoFelt252, CairoUint32
…Compiler + custom parser
…d narrow response type
* feat: reduce TX wait time, and provide known failed reasons based on TX flow * test: eventless write bytearray xtest * feat: uint static factory methods * refactor: cleanup * feat: missing primitive integers implemented as cairo types * chore: cleanup
Co-authored-by: Petar Penović <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General approach lgtm
Several tests are not passing, left a change suggestion for utils/typedData.ts
that should address some of them.
A set of less important changes that could be made is that several typeof
usages could be replaced with corresponding utils/typed.ts
methods.
const elements = [ | ||
byteArray.data.length, | ||
...byteArray.data, | ||
byteArray.pending_word, | ||
byteArray.pending_word_len, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const elements = [ | |
byteArray.data.length, | |
...byteArray.data, | |
byteArray.pending_word, | |
byteArray.pending_word_len, | |
]; | |
const elements = byteArray.toApiRequest(); |
This change should make the related tests pass. The as BigNumberish[]
cast on the following line can then also be removed.
Motivation and Resolution
Goal:
OO "self-contained composable" - CairoType
AR "accurate representation" - Byte representation
DD "Data-driven configurability" - Strategy Map
Usage related changes
Development related changes
Instead of functional parsing and utils for api, have self-contained CairoTypes similar to the native JS types (Number, String, BigInt....)
Checklist: