Skip to content

Commit

Permalink
Simplify test helpers, take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalinin committed Oct 22, 2024
1 parent f2e45fb commit d53419b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions tests/core/pyspec/eth2spec/test/helpers/consolidations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@

def prepare_switch_to_compounding_request(spec, state, validator_index, address=None):
validator = state.validators[validator_index]

# Set the supplied address or the default one if needed
if address is not None or not spec.has_execution_withdrawal_credential(validator):
if not spec.has_execution_withdrawal_credential(validator):
set_eth1_withdrawal_credential_with_balance(spec, state, validator_index, address=address)

return spec.ConsolidationRequest(
Expand Down
4 changes: 1 addition & 3 deletions tests/core/pyspec/eth2spec/test/helpers/withdrawals.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ def prepare_pending_withdrawal(spec, state, validator_index,

def prepare_withdrawal_request(spec, state, validator_index, address=None, amount=None):
validator = state.validators[validator_index]

# Set the supplied address or the default one if needed
if address is not None or not spec.has_execution_withdrawal_credential(validator):
if not spec.has_execution_withdrawal_credential(validator):
set_eth1_withdrawal_credential_with_balance(spec, state, validator_index, address=address)

if amount is None:
Expand Down

0 comments on commit d53419b

Please sign in to comment.