Summary
Improve test case readability, raw hex arrays in parametrized tests are hard to parse without knowing the argument structure of each precompile. For example:
@pytest.mark.parametrize(
"precompile_address,calldata,target",
[
pytest.param(
0x06,
concatenate_parameters(
[
"18B18ACFB4C2C30276DB5411368E7185B311DD124691610C5D3B74034E093DC9",
"063C909C4720840CB5134CB9F59FA749755796819658D32EFC0D288198F37266",
...
]
),
...
),
],
)
It's unclear what each hex string represents (e.g. x-coordinate, y-coordinate, field element).
Proposed Improvements
- Define named constants for precompile addresses (e.g. instead of raw
0x06)
- Add helper/factory functions per precompile, similar to the existing
create_modexp_test_cases, so inputs are constructed with labeled parameters
Summary
Improve test case readability, raw hex arrays in parametrized tests are hard to parse without knowing the argument structure of each precompile. For example:
It's unclear what each hex string represents (e.g. x-coordinate, y-coordinate, field element).
Proposed Improvements
0x06)create_modexp_test_cases, so inputs are constructed with labeled parameters