Skip to content

Commit

Permalink
new(tests): eip-2537: more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marioevz committed May 17, 2024
1 parent 3256585 commit 8729572
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ def test_valid(
b"",
id="zero_length_input",
),
pytest.param(
Spec.G1,
id="only_one_point",
),
pytest.param(
Spec.G2 + Spec.G2,
id="g2_points",
),
],
)
@pytest.mark.parametrize("expected_output", [Spec.INVALID], ids=[""])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ def test_valid(
Spec.P1_NOT_IN_SUBGROUP_TIMES_2 + Scalar(Spec.Q),
id="not_in_subgroup_2",
),
pytest.param(
Spec.G1,
id="bls_g1_truncated_input",
),
],
# Input length tests can be found in ./test_bls12_variable_length_input_contracts.py
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ def test_valid(
b"",
id="zero_length_input",
),
pytest.param(
Spec.G2,
id="only_one_point",
),
pytest.param(
Spec.G1 + Spec.G1,
id="g1_points",
),
],
)
@pytest.mark.parametrize("expected_output", [Spec.INVALID], ids=[""])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def test_valid(
Spec.P2_NOT_IN_SUBGROUP + Scalar(1),
id="bls_g2mul_not_in_subgroup",
),
pytest.param(
Spec.G2,
id="bls_g2_truncated_input",
),
# Input length tests can be found in ./test_bls12_variable_length_input_contracts.py
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def test_valid(
pytest.param(FP2((0, Spec.P)), id="fq_eq_q_2"),
pytest.param(FP2((2**512 - 1, 0)), id="fq_eq_2_512_minus_1"),
pytest.param(FP2((0, 2**512 - 1)), id="fq_eq_2_512_minus_1_2"),
pytest.param(Spec.G2, id="g2_input"),
],
)
@pytest.mark.parametrize("expected_output", [Spec.INVALID], ids=[""])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def test_valid(
pytest.param(b"", id="zero_length_input"),
pytest.param(FP(Spec.P), id="fq_eq_q"),
pytest.param(FP(2**512 - 1), id="fq_eq_2_512_minus_1"),
pytest.param(Spec.G1, id="g1_point_input"),
],
)
@pytest.mark.parametrize("expected_output", [Spec.INVALID], ids=[""])
Expand Down

0 comments on commit 8729572

Please sign in to comment.