diff --git a/tests/test_bls.py b/tests/test_bls.py index aa24f159..7cec7380 100644 --- a/tests/test_bls.py +++ b/tests/test_bls.py @@ -249,27 +249,21 @@ def test_multi_multi(): pubkeys = [privtopub(k) for k in privkeys] class Attestation: - def __init__(self, msg_1, msg_2): - msg_1_validators = sample(validator_indices, 3) - msg_2_validators = sample(validator_indices, 3) + def __init__(self): + msg_1_validators = (1, 2, 3, 4) + msg_2_validators = (4, 5, 6, 7) self.agg_pubkeys = [ aggregate_pubkeys([pubkeys[i] for i in msg_1_validators]), aggregate_pubkeys([pubkeys[i] for i in msg_2_validators]), ] - self.msgs = [msg_1, msg_2] - msg_1_sigs = [sign(msg_1, privkeys[i], domain) for i in msg_1_validators] - msg_2_sigs = [sign(msg_2, privkeys[i], domain) for i in msg_2_validators] + self.msgs = (b'\x12' * 32, b'\x34' * 32) + msg_1_sigs = [sign(self.msgs[0], privkeys[i], domain) for i in msg_1_validators] + msg_2_sigs = [sign(self.msgs[1], privkeys[i], domain) for i in msg_2_validators] self.sig = aggregate_signatures([ aggregate_signatures(msg_1_sigs), aggregate_signatures(msg_2_sigs), ]) - - msgs = ( - (b'\x12' * 32, b'\x34' * 32), - (b'\x56' * 32, b'\x78' * 32), - (b'\x90' * 32, b'\xab' * 32), - ) - atts = [Attestation(msg_1, msg_2) for msg_1, msg_2 in msgs] + atts = (Attestation(),) * 3 assert verify_multiple_multiple( signatures=[att.sig for att in atts], pubkeys_and_messages=[[att.agg_pubkeys, att.msgs] for att in atts],