test(p/uint256): add randomize fuzz tests #1014
Merged
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.



Descriptions
Add comprehensive fuzz tests for uint256 operations to verify correctness through randomized property-based testing.
Changes
New Test Files
Added 6 new test files under
contract/r/gnoswap/test/fuzz/:uint256_arithmetic_fuzz_params_test.gno- Parameter definitions for arithmetic law testsuint256_arithmetic_fuzz_test.gno- Arithmetic property tests (associativity, commutativity, distributivity, identity)uint256_fuzz_params_test.gno- Parameter definitions for basic operationsuint256_fuzz_test.gno- Basic operation tests (Mul, Div, Mod, Add, Sub, overflow checks)uint256_math_fuzz_params_test.gno- Parameter definitions for math functionsuint256_math_fuzz_test.gno- Math function tests (MulDiv, MulDivRoundingUp, DivRoundingUp)Test Categories
Arithmetic Laws
Basic Operations
Math Functions
Sparse Multiplication (umul)
Validation Logic
Each test includes
IsValid()predicate functions that accurately predict operation outcomes:mulHi()function computes upper 256 bits of 512-bit multiplication for overflow detection