Adjust MAX_UINT32 and MAX_UINT48 constants in Time.test.js
#6095
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The test was using
1n << (32n - 1n)which gives 2^31 instead of the actual max value 2^32-1. Same issue with MAX_UINT48.This meant only half of the valid uint32/uint48 range was being tested - values from 2,147,483,649 to 4,294,967,295 were never checked.
Changed to
2n ** 32n - 1nto match what Solidity actually allows (type(uint32).max) and to be consistent with test/helpers/constants.js.