fix tests with new starT_epoch and end_epoch in Crosslink

This commit is contained in:
Danny Ryan 2019-05-19 15:47:59 -06:00
parent 85c1654456
commit a2108741e8
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
3 changed files with 6 additions and 4 deletions

View File

@ -9,4 +9,4 @@ def bls_verify_multiple(pubkeys, message_hashes, signature, domain):
def bls_aggregate_pubkeys(pubkeys):
return b'\x42' * 96
return b'\x42' * 48

View File

@ -124,7 +124,7 @@ def test_bad_previous_crosslink(state):
for _ in range(spec.MIN_ATTESTATION_INCLUSION_DELAY):
next_slot(state)
state.current_crosslinks[attestation.data.crosslink.shard].epoch += 10
state.current_crosslinks[attestation.data.crosslink.shard].end_epoch += 10
pre_state, post_state = run_attestation_processing(state, attestation, False)

View File

@ -177,6 +177,7 @@ def build_attestation_data(state, slot, shard):
justified_block_root = state.current_justified_root
crosslinks = state.current_crosslinks if slot_to_epoch(slot) == get_current_epoch(state) else state.previous_crosslinks
parent_crosslink = crosslinks[shard]
return AttestationData(
beacon_block_root=block_root,
source_epoch=justified_epoch,
@ -185,9 +186,10 @@ def build_attestation_data(state, slot, shard):
target_root=epoch_boundary_root,
crosslink=Crosslink(
shard=shard,
epoch=min(slot_to_epoch(slot), crosslinks[shard].epoch + MAX_EPOCHS_PER_CROSSLINK),
start_epoch=parent_crosslink.end_epoch,
end_epoch=min(slot_to_epoch(slot), parent_crosslink.end_epoch + MAX_EPOCHS_PER_CROSSLINK),
data_root=spec.ZERO_HASH,
parent_root=hash_tree_root(crosslinks[shard]),
parent_root=hash_tree_root(parent_crosslink),
),
)