update attestations and voluntary exit operations test to 0.10.1

This commit is contained in:
Dustin Brody 2020-01-30 11:54:15 +01:00 committed by tersec
parent 45dd12cf3f
commit 9748b2606e
3 changed files with 27 additions and 14 deletions

View File

@ -66,18 +66,27 @@ template runTest(testName: string, identifier: untyped) =
`testImpl _ operations_attestations _ identifier`() `testImpl _ operations_attestations _ identifier`()
suite "Official - Operations - Attestations " & preset(): suite "Official - Operations - Attestations " & preset():
runTest("success", success) # https://github.com/ethereum/eth2.0-spec-tests/tree/v0.10.1/tests/minimal/phase0/operations/attestation/pyspec_tests
runTest("success previous epoch", success_previous_epoch) # https://github.com/ethereum/eth2.0-spec-tests/tree/v0.10.1/tests/mainnet/phase0/operations/attestation/pyspec_tests
runTest("invalid attestation signature", invalid_attestation_signature)
runTest("before inclusion delay", before_inclusion_delay)
runTest("after_epoch_slots", after_epoch_slots) runTest("after_epoch_slots", after_epoch_slots)
runTest("bad source root", bad_source_root)
runTest("before inclusion delay", before_inclusion_delay)
runTest("empty aggregation bits", empty_aggregation_bits)
runTest("future target epoch", future_target_epoch)
runTest("invalid attestation signature", invalid_attestation_signature)
runTest("invalid current source root", invalid_current_source_root)
runTest("invalid index", invalid_index)
runTest("mismatched target and slot", mismatched_target_and_slot)
runTest("new source epoch", new_source_epoch)
runTest("old source epoch", old_source_epoch) runTest("old source epoch", old_source_epoch)
runTest("old target epoch", old_target_epoch) runTest("old target epoch", old_target_epoch)
runTest("future target epoch", future_target_epoch)
runTest("new source epoch", new_source_epoch)
runTest("source root is target root", source_root_is_target_root) runTest("source root is target root", source_root_is_target_root)
runTest("invalid current source root", invalid_current_source_root) runTest("success", success)
runTest("bad source root", bad_source_root) runTest("success multi-proposer index interations",
runTest("empty aggregation bits", empty_aggregation_bits) success_multi_proposer_index_iterations)
runTest("too many aggregation bits", too_many_aggregation_bits) runTest("success previous epoch", success_previous_epoch)
runTest("too few aggregation bits", too_few_aggregation_bits) runTest("too few aggregation bits", too_few_aggregation_bits)
runTest("too many aggregation bits", too_many_aggregation_bits)
runTest("wrong index for committee signature",
wrong_index_for_committee_signature)
runTest("wrong index for slot", wrong_index_for_slot)

View File

@ -64,16 +64,18 @@ template runTest(identifier: untyped) =
`testImpl _ voluntary_exit _ identifier`() `testImpl _ voluntary_exit _ identifier`()
suite "Official - Operations - Voluntary exit " & preset(): suite "Official - Operations - Voluntary exit " & preset():
# https://github.com/ethereum/eth2.0-spec-tests/tree/v0.10.1/tests/minimal/phase0/operations/voluntary_exit/pyspec_tests
# https://github.com/ethereum/eth2.0-spec-tests/tree/v0.10.1/tests/mainnet/phase0/operations/voluntary_exit/pyspec_tests
runTest(success) runTest(success)
when false: when false:
# TODO not sure how this particularly could falsely succeed # TODO not sure how this particularly could falsely succeed
runTest(invalid_signature) runTest(invalid_signature)
runTest(validator_invalid_validator_index)
runTest(validator_already_exited)
runTest(success_exit_queue) runTest(success_exit_queue)
runTest(validator_exit_in_future) runTest(validator_exit_in_future)
runTest(validator_invalid_validator_index) runTest(default_exit_epoch_subsequent_exit)
runTest(validator_not_active)
runTest(validator_already_exited)
runTest(validator_not_active_long_enough) runTest(validator_not_active_long_enough)
runTest(validator_not_active)

View File

@ -47,6 +47,8 @@ template runTest(testName: string, identifier: untyped, num_slots: uint64): unty
# --------------------------------------------------------------- # ---------------------------------------------------------------
suite "Official - Sanity - Slots " & preset(): suite "Official - Sanity - Slots " & preset():
# https://github.com/ethereum/eth2.0-spec-tests/tree/v0.10.1/tests/minimal/phase0/sanity/slots/pyspec_tests
# https://github.com/ethereum/eth2.0-spec-tests/tree/v0.10.1/tests/mainnet/phase0/sanity/slots/pyspec_tests
runTest("Advance 1 slot", slots_1, 1) runTest("Advance 1 slot", slots_1, 1)
runTest("Advance 2 slots", slots_2, 2) runTest("Advance 2 slots", slots_2, 2)
runTest("Advance an empty epoch", empty_epoch, SLOTS_PER_EPOCH) runTest("Advance an empty epoch", empty_epoch, SLOTS_PER_EPOCH)