starknet.js icon indicating copy to clipboard operation
starknet.js copied to clipboard

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

Open fmmesen opened this issue 1 year ago • 4 comments

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:

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

fmmesen avatar Jul 05 '24 08:07 fmmesen

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

fmmesen avatar Jul 05 '24 08:07 fmmesen

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

fmmesen avatar Jul 17 '24 16:07 fmmesen

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.

penovicp avatar Jul 24 '24 19:07 penovicp

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

fmmesen avatar Oct 22 '24 05:10 fmmesen

Closing this one in the favor of the new CairoType Classes

tabaktoni avatar Sep 08 '25 06:09 tabaktoni