-
Notifications
You must be signed in to change notification settings - Fork 757
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
Add test and support for negative Signed integers smaller than 252 bits #1014
Comments
@tabaktoni Can I work on this one after completing #1018 ? :) |
Yes ofc, maybe the task will need to be expanded to multiple sub tasks we will need to check how to implement all Cairo int types in the manner of CairoInt. |
Got it! I'll start looking into the tests first! Then see how to break this down into subtasks :) |
Task will be offered again on the ODHack event |
@ivpavici I'm still working on the other issue. So please don't unassign there 😅 |
ok when you are done there we can assign you here if no one else wants to pick it up |
Hey! I am from Argentina. I am at the mu. I want to contribute and make this my first issue. Regards! |
@lucilapastore good luck! |
Could I work on this? @ivpavici |
good luck! |
Hey @ivpavici , sorry for the delay! I just have a doubt Doing the serialization manually: 2^{251} + 172^{192} + 1 - 5 I'll receive: 3618502788666131113263695016908177884250476444008934042335404944711319814140 So the idea is to create a unit test that will expect(result).ToBe(361850278866613111......) for i8, i16, i32, i64 and i128? |
Implementation needs to be the similar to CairoUint256 In addition to this you need to define and store:
The class will contain all these properties + existing ones as in the uint256 example. So to finally answer the question, yes for unit testing you need to test all Class methods as you described, but in e2e test you will expect -5. |
Understood, I'll update you soon! |
Is your feature request related to a problem? Please describe.
https://docs.starknet.io/documentation/architecture_and_concepts/Smart_Contracts/serialization_of_Cairo_types/#data_types_of_252_bits_or_less
Describe the solution you'd like
Test current behavior and support required field el calc
i8, i16, i32, i64, and i128
Negativ value should be 2^{251} + 172^{192} + 1 + (negative value)
ex -5 should serialise to 2^{251} + 172^{192} + 1 - 5
The text was updated successfully, but these errors were encountered: