Skip to content

Commit

Permalink
fix mypy type stubs in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Nov 28, 2023
1 parent 99079b6 commit f8afe9c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/test_blspy_fidelity.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def test_bls() -> None:
PrivateKey,
)

def test_schemes():
def test_schemes() -> None:
# fmt: off
seed = bytes([
0, 50, 6, 244, 24, 199, 1, 25, 52, 88, 192, 19, 18, 12, 89, 6,
Expand Down Expand Up @@ -272,7 +272,7 @@ def test_schemes():
assert Scheme.verify(childUPk, msg, sigU_child)


def test_vectors_invalid():
def test_vectors_invalid() -> None:
# Invalid inputs from https://github.com/algorand/bls_sigs_ref/blob/master/python-impl/serdesZ.py
invalid_inputs_1 = [
# infinity points: too short
Expand Down Expand Up @@ -314,21 +314,21 @@ def test_vectors_invalid():
for s in invalid_inputs_1:
bytes_ = binascii.unhexlify(s)
try:
g1 = G1Element(bytes_)
g1 = G1Element.from_bytes(bytes_)
assert False, "Failed to disallow creation of G1 element."
except Exception as e:
pass

for s in invalid_inputs_2:
bytes_ = binascii.unhexlify(s)
try:
g2 = G2Element(bytes_)
g2 = G2Element.from_bytes(bytes_)
assert False, "Failed to disallow creation of G2 element."
except Exception as e:
pass


def test_vectors_valid():
def test_vectors_valid() -> None:
# The following code was used to generate these vectors
"""
from py_ecc.bls import (
Expand Down Expand Up @@ -391,7 +391,7 @@ def test_vectors_valid():
# assert bytes(sigAPop) == ref_sigAPop


def test_readme():
def test_readme() -> None:
seed: bytes = bytes(
[
0,
Expand Down Expand Up @@ -518,11 +518,11 @@ def test_readme():
assert ok


def test_aggregate_verify_zero_items():
def test_aggregate_verify_zero_items() -> None:
assert AugSchemeMPL.aggregate_verify([], [], G2Element())


def test_invalid_points():
def test_invalid_points() -> None:
sk1 = AugSchemeMPL.key_gen(b"1" *32)
good_point = sk1.get_g1()
good_point_bytes = bytes(good_point)
Expand Down

0 comments on commit f8afe9c

Please sign in to comment.