This commit is contained in:
Danny Ryan
2019-06-24 21:09:57 -06:00
parent 751738f411
commit d9b97578c0
4 changed files with 16 additions and 10 deletions

View File

@@ -11,7 +11,7 @@ def run_on_attestation(spec, state, store, attestation, valid=True):
if not valid:
try:
spec.on_attestation(store, attestation)
except:
except AssertionError:
return
else:
assert False
@@ -131,4 +131,4 @@ def test_on_attestation_invalid_attestation(spec, state):
attestation = get_valid_attestation(spec, state, slot=block.slot)
# make attestation invalid
attestation.custody_bitfield = b'\xf0' + attestation.custody_bitfield[1:]
run_on_attestation(spec, state, store, attestation, False)
run_on_attestation(spec, state, store, attestation, False)

View File

@@ -9,7 +9,7 @@ def run_on_block(spec, state, store, block, valid=True):
if not valid:
try:
spec.on_block(store, block)
except:
except AssertionError:
return
else:
assert False
@@ -88,8 +88,11 @@ def test_on_block_before_finalized(spec, state):
time = 100
spec.on_tick(store, time)
store.finalized_checkpoint = spec.Checkpoint(epoch=store.finalized_checkpoint.epoch + 2, root=store.finalized_checkpoint.root)
store.finalized_checkpoint = spec.Checkpoint(
epoch=store.finalized_checkpoint.epoch + 2,
root=store.finalized_checkpoint.root
)
# Fail receiving block of `GENESIS_SLOT + 1` slot
block = build_empty_block_for_next_slot(spec, state)
run_on_block(spec, state, store, block, False)
run_on_block(spec, state, store, block, False)