Skip to content

Commit

Permalink
Merge pull request #2252 from ethereum/fix-gens
Browse files Browse the repository at this point in the history
fix v1.1.0-alpha.1 test generators
  • Loading branch information
djrtwo authored Mar 17, 2021
2 parents 3ce090f + 1707978 commit 409cf0f
Showing 1 changed file with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ def test_invalid_signature_missing_participant(spec, state):
rng = random.Random(2020)
random_participant = rng.choice(committee)

yield 'pre', state

block = build_empty_block_for_next_slot(spec, state)
# Exclude one participant whose signature was included.
block.body.sync_aggregate = spec.SyncAggregate(
Expand Down Expand Up @@ -168,8 +166,6 @@ def validate_sync_committee_rewards(spec, pre_state, post_state, committee, comm


def run_successful_sync_committee_test(spec, state, committee, committee_bits):
yield 'pre', state

pre_state = state.copy()

block = build_empty_block_for_next_slot(spec, state)
Expand Down Expand Up @@ -211,17 +207,6 @@ def test_sync_committee_rewards_nonduplicate_committee(spec, state):
yield from run_successful_sync_committee_test(spec, state, committee, committee_bits)


@with_all_phases_except([PHASE0, PHASE1])
@spec_state_test
@always_bls
def test_sync_committee_rewards_not_full_participants(spec, state):
committee = get_committee_indices(spec, state, duplicates=False)
rng = random.Random(1010)
committee_bits = [rng.choice([True, False]) for _ in committee]

yield from run_successful_sync_committee_test(spec, state, committee, committee_bits)


@with_all_phases_except([PHASE0, PHASE1])
@with_configs([MAINNET], reason="to create duplicate committee")
@spec_state_test
Expand All @@ -238,6 +223,17 @@ def test_sync_committee_rewards_duplicate_committee(spec, state):
yield from run_successful_sync_committee_test(spec, state, committee, committee_bits)


@with_all_phases_except([PHASE0, PHASE1])
@spec_state_test
@always_bls
def test_sync_committee_rewards_not_full_participants(spec, state):
committee = spec.get_sync_committee_indices(state, spec.get_current_epoch(state))
rng = random.Random(1010)
committee_bits = [rng.choice([True, False]) for _ in committee]

yield from run_successful_sync_committee_test(spec, state, committee, committee_bits)


@with_all_phases_except([PHASE0, PHASE1])
@spec_state_test
@always_bls
Expand Down

0 comments on commit 409cf0f

Please sign in to comment.