Skip to content

Commit 1f41b21

Browse files
benchmarks/compute/precompile/test_sha256.py: Add 64 byte test cases. (#2801)
benchmarks/compute/precompile/test_ripemd160.py: Add 64 byte test cases. Due to how, internally, padding+splitting into blocks (of 64bytes) in the actual hash functions works, even multiples of 32bytes behave slightly differently wrt. gas pricing. So we need to add a 64byte test case here.
1 parent 8fa9a05 commit 1f41b21

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tests/benchmark/compute/precompile/test_ripemd160.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_ripemd160(
5353

5454

5555
@pytest.mark.repricing
56-
@pytest.mark.parametrize("size", [0, 32, 256, 1024])
56+
@pytest.mark.parametrize("size", [0, 32, 64, 256, 1024])
5757
def test_ripemd160_fixed_size(
5858
benchmark_test: BenchmarkTestFiller, size: int
5959
) -> None:
@@ -71,7 +71,7 @@ def test_ripemd160_fixed_size(
7171

7272

7373
@pytest.mark.repricing
74-
@pytest.mark.parametrize("size", [32, 256, 1024])
74+
@pytest.mark.parametrize("size", [32, 64, 256, 1024])
7575
def test_ripemd160_uncachable(
7676
benchmark_test: BenchmarkTestFiller,
7777
pre: Alloc,

tests/benchmark/compute/precompile/test_sha256.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_sha256(
5353

5454

5555
@pytest.mark.repricing
56-
@pytest.mark.parametrize("size", [0, 32, 256, 1024])
56+
@pytest.mark.parametrize("size", [0, 32, 64, 256, 1024])
5757
def test_sha256_fixed_size(
5858
benchmark_test: BenchmarkTestFiller, size: int
5959
) -> None:
@@ -71,7 +71,7 @@ def test_sha256_fixed_size(
7171

7272

7373
@pytest.mark.repricing
74-
@pytest.mark.parametrize("size", [32, 256, 1024])
74+
@pytest.mark.parametrize("size", [32, 64, 256, 1024])
7575
def test_sha256_uncachable(
7676
benchmark_test: BenchmarkTestFiller,
7777
pre: Alloc,

0 commit comments

Comments
 (0)