You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add signed to unsigned conversion to SafeCast
* Update SafeCast exception message
* Add test for SafeCast int to uint conversion
- Update SafeCastMock
- Add tests for SafeCast int256 to uint256
* Update SafeCast int to uint definition
Apply suggestions from code review.
Co-Authored-By: Nicolás Venturo <nicolas.venturo@gmail.com>
* Update test for SafeCast int to uint conversion
* Update SafeCast test after code review
- Change "downcasts" to "casts"
- Move test closer to its function
* Fix error in SafeCast toUint256 description
* Fix breaking error in SafeCast
* Add uint256 to int256 conversion to SafeCast
- Add function
- Add mock
- Add test
* Update SafeCast unsigned to signed conversion
- Update error in conversion to be more clear
- Update constants in test to be powers of 2 instead of shifts
* Add changelog entry
* Update SafeCast tests
- Add minus in INT256_MIN for clarity
Co-Authored-By: Nicolás Venturo <nicolas.venturo@gmail.com>
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
We should include a function
SafeCast.toUint256(int256) returns (uint256)
. It should check that the value isn't negative.We may also want to consider the inverse, unsigned to signed:
SafeCast.toInt256(uint256) returns (int256)
.The text was updated successfully, but these errors were encountered: