Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
potuz committed Nov 4, 2022
1 parent 9973e9f commit e15b02d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions specs/capella/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,15 @@ def get_expected_withdrawals(state: BeaconState) -> Sequence[Withdrawal]:
address=ExecutionAddress(val.withdrawal_credentials[12:]),
amount=balance,
))
withdrawal_index += 1
withdrawal_index += WithdrawalIndex(1)
elif is_partially_withdrawable_validator(val, balance):
withdrawals.append(Withdrawal(
index=withdrawal_index,
validator_index=validator_index,
address=ExecutionAddress(val.withdrawal_credentials[12:]),
amount=balance - MAX_EFFECTIVE_BALANCE,
))
withdrawal_index += 1
withdrawal_index += WithdrawalIndex(1)
if len(withdrawals) == MAX_WITHDRAWALS_PER_PAYLOAD:
break
return withdrawals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
set_validator_partially_withdrawable,
)


def prepare_expected_withdrawals(spec, state,
num_full_withdrawals=0, num_partial_withdrawals=0, rng=random.Random(5566)):
assert num_full_withdrawals + num_partial_withdrawals <= len(state.validators)
Expand Down Expand Up @@ -297,6 +298,7 @@ def test_fail_a_lot_partially_withdrawable_too_few_in_withdrawals(spec, state):

yield from run_withdrawals_processing(spec, state, execution_payload, valid=False)


@with_capella_and_later
@spec_state_test
def test_fail_a_lot_mixed_withdrawable_in_queue_too_few_in_withdrawals(spec, state):
Expand All @@ -310,7 +312,6 @@ def test_fail_a_lot_mixed_withdrawable_in_queue_too_few_in_withdrawals(spec, sta
yield from run_withdrawals_processing(spec, state, execution_payload, valid=False)



#
# Failure cases in which the withdrawals in the execution_payload are incorrect
#
Expand Down Expand Up @@ -794,7 +795,6 @@ def test_random_partial_withdrawals_5(spec, state):


# Tests with multiple blocks

@with_capella_and_later
@spec_state_test
def test_success_two_payloads(spec, state):
Expand All @@ -817,6 +817,7 @@ def test_success_two_payloads(spec, state):
verify_post_state(state, spec, expected_withdrawals, fully_withdrawable_indices, partial_withdrawals_indices)
assert state.next_withdrawal_index == next_withdrawal_index + spec.MAX_WITHDRAWALS_PER_PAYLOAD * 2


@with_capella_and_later
@spec_state_test
def test_fail_second_payload_isnt_compatible(spec, state):
Expand All @@ -836,5 +837,4 @@ def test_fail_second_payload_isnt_compatible(spec, state):

execution_payload = build_empty_execution_payload(spec, state)
state.next_withdrawal_index += 1
yield from run_withdrawals_processing(spec, state, execution_payload)

yield from run_withdrawals_processing(spec, state, execution_payload, valid=False)

0 comments on commit e15b02d

Please sign in to comment.