Skip to content

Commit 696e5a8

Browse files
pdobaczBaltoli
andcommitted
feat(tests): EIP-198 modexp cases with truncated inputs
Test case authored by Category Labs team in category-labs/monad#2045 Co-authored-by: Baltoli <1329034+Baltoli@users.noreply.github.com>
1 parent 87a414f commit 696e5a8

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

tests/byzantium/eip198_modexp_precompile/test_modexp.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,56 @@
399399
),
400400
id="mod-264-even-ctz-48",
401401
),
402+
pytest.param(
403+
Bytes(
404+
"0x00000000000000000000000000000000"
405+
"0000000000000000100000000000000000000000000000000"
406+
"0000000000000000000000000000000100000000000000000"
407+
"000000000000000000000000000000005"
408+
),
409+
ModExpOutput(
410+
call_success=False,
411+
returned_data="0000000000000000000000000000000000000000000000000000000000000000",
412+
),
413+
id="truncated_input1",
414+
),
415+
pytest.param(
416+
Bytes(
417+
"0x00000000000000000000000000000000000000000"
418+
"0000000000000000000000100000000000000000000"
419+
"00000000000000000000000000000005"
420+
),
421+
ModExpOutput(
422+
call_success=False,
423+
returned_data="0000000000000000000000000000000000000000000000000000000000000000",
424+
),
425+
id="truncated_input2",
426+
),
427+
pytest.param(
428+
Bytes(
429+
"0x00000000000000000000000000000000000000000000000000000500"
430+
),
431+
ModExpOutput(
432+
call_success=False,
433+
returned_data="0000000000000000000000000000000000000000000000000000000000000000",
434+
),
435+
id="truncated_input3",
436+
),
437+
pytest.param(
438+
Bytes(
439+
"0x00000000000000000000000000000000000"
440+
"000000000000000000000"
441+
"0000000100000000000000000000000000000"
442+
"000000000000000000000"
443+
"0000000000000200000000000000000000000"
444+
"000000000000000000000"
445+
"000000000000000000050201"
446+
),
447+
ModExpOutput(
448+
returned_data="0x0000000000",
449+
),
450+
id="truncated_input4",
451+
),
402452
],
403453
ids=lambda param: param.__repr__(), # only required to remove parameter
404454
# names (input/output)

0 commit comments

Comments
 (0)