starknet.js
starknet.js copied to clipboard
Add test and support for negative Signed integers smaller than 252 bits
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
Hello @tabaktoni @ivpavici ! New feature is done and ready to be reviewed.
Hello @penovicp, I have a doubt about where exactly I should use those classes for request/response handling. Could you provide some guidance?
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 Already used the utility classes, please let me know if you see that I'm missing something
Closing this one in the favor of the new CairoType Classes