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

Add test and support for negative Signed integers smaller than 252 bits #1177

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

fmmesen
Copy link

@fmmesen fmmesen commented Jul 5, 2024

feat: added new data types
test: added new tests for data types
#1014

Motivation and Resolution

Created new Cairo Data Types integer classes and their unit tests for every range of bits below 252, similar to the uint256.ts file.

Development related changes

  • Added cairoInt, int8, int16, int32, int64, int128 clases.
  • Added tests for every new data type.

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Linked the issues which this PR resolves
  • Documented the changes in code (API docs will be generated automatically)
  • Updated the tests
  • All tests are passing

test: added new tests for data types
@fmmesen
Copy link
Author

fmmesen commented Jul 5, 2024

Hello @tabaktoni @ivpavici !
New feature is done and ready to be reviewed.

@ivpavici ivpavici requested a review from penovicp July 10, 2024 12:44
Copy link
Collaborator

@penovicp penovicp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of the linked issue isn't to just create the corresponding utility classes but to actually use them for request/response handling.

Also, CairoInt looks like it should be an abstract class and the type implementation classes look like they could have improved code reuse.

@fmmesen
Copy link
Author

fmmesen commented Jul 17, 2024

Hello @penovicp, I have a doubt about where exactly I should use those classes for request/response handling. Could you provide some guidance?

@penovicp
Copy link
Collaborator

This comment describes what the required behaviour should be.

The existing data type utility classes such as CairoUint256 and CairoUint512 can be checked to see how and where the signed integer classes should be used.

@fmmesen
Copy link
Author

fmmesen commented Oct 22, 2024

@penovicp Already used the utility classes, please let me know if you see that I'm missing something

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.

3 participants