Skip to content
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

feat: accept numbers for NUM_AS_HEX #491

Merged
merged 1 commit into from
Nov 1, 2023
Merged

Conversation

xJonathanLEI
Copy link
Owner

While the official specs indicate that NUM_AS_HEX must be strings, some Starknet libraries expect numbers to be acceptable in certain cases. Adding support for this technically breaks the specs but it's acceptable since it's only on the deserialization side.

Also changes the NumAsHex implementation to remove the unnecessary allocation for String. This makes deserialization slightly more efficient.

While the official specs indicate that `NUM_AS_HEX` must be strings,
some Starknet libraries expect numbers to be acceptable in certain
cases. Adding support for this technically breaks the specs but it's
acceptable since it's only on the deserialization side.

Also changes the `NumAsHex` implementation to remove the unnecessary
allocation for `String`. This makes deserialization slightly more
efficient.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant