Skip to content
This repository was archived by the owner on Jul 1, 2021. It is now read-only.

Commit 01b78f6

Browse files
committed
Fix after rebasing
Fix `BeaconChainFactory` after rebasing Fix after new SSZ Hashable structure
1 parent 49a2cf2 commit 01b78f6

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

eth2/beacon/tools/builder/aggregator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def get_aggregate_from_valid_committee_attestations(
8686

8787
assert len(attestations) > 0
8888

89-
return Attestation(
89+
return Attestation.create(
9090
data=attestations[0].data,
9191
aggregation_bits=Bitfield(aggregation_bits),
9292
signature=aggregate_signature,

eth2/beacon/tools/factories.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ def _create(
5151
else:
5252
num_validators = cls.num_validators
5353

54-
keymap = mk_keymap_of_size(num_validators)
55-
5654
if kwargs["genesis_state"] is None:
57-
keymap = mk_keymap_of_size(cls.num_validators)
55+
keymap = mk_keymap_of_size(num_validators)
5856
genesis_state, genesis_block = create_mock_genesis(
5957
config=cls.config,
6058
pubkeys=tuple(keymap.keys()),

eth2/beacon/types/aggregate_and_proof.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def create(
2929
selection_proof: BLSSignature = EMPTY_SIGNATURE,
3030
) -> TAggregateAndProof:
3131
return super().create(
32-
aggregator_index=aggregator_index, aggregate=aggregate, selection_proof=selection_proof
32+
aggregator_index=aggregator_index,
33+
aggregate=aggregate,
34+
selection_proof=selection_proof,
3335
)
3436

3537
def __str__(self) -> str:

tests/eth2/core/beacon/tools/builder/test_aggregator.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,18 @@ def test_get_aggregate_from_valid_committee_attestations(
5959
):
6060
committee_size = 16
6161
empty_bitfield = get_empty_bitfield(committee_size)
62-
base_attestation = Attestation(**sample_attestation_params)
62+
base_attestation = Attestation.create(**sample_attestation_params)
6363
message_hash = base_attestation.data.hash_tree_root
6464
attestations = []
6565
expected_bitfield = empty_bitfield
6666

6767
for i in range(4, 16, 2):
6868
attestations.append(
69-
base_attestation.copy(
70-
aggregation_bits=set_voted(empty_bitfield, i),
71-
signature=sign_transaction(
69+
base_attestation.mset(
70+
"aggregation_bits",
71+
set_voted(empty_bitfield, i),
72+
"signature",
73+
sign_transaction(
7274
message_hash=message_hash,
7375
privkey=privkeys[i],
7476
state=genesis_state,

trinity/components/eth2/beacon/validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ async def aggregate(
524524
# 3. For each aggregate
525525
# (it's possible with same CommitteeIndex and different AttesatationData)
526526
for aggregate in aggregates:
527-
aggregate_and_proof = AggregateAndProof(
527+
aggregate_and_proof = AggregateAndProof.create(
528528
aggregator_index=validator_index,
529529
aggregate=aggregate,
530530
selection_proof=selected_proofs[validator_index],

0 commit comments

Comments
 (0)