Skip to content

Commit d53419b

Browse files
committed
Simplify test helpers, take 2
1 parent f2e45fb commit d53419b

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

tests/core/pyspec/eth2spec/test/helpers/consolidations.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55

66
def prepare_switch_to_compounding_request(spec, state, validator_index, address=None):
77
validator = state.validators[validator_index]
8-
9-
# Set the supplied address or the default one if needed
10-
if address is not None or not spec.has_execution_withdrawal_credential(validator):
8+
if not spec.has_execution_withdrawal_credential(validator):
119
set_eth1_withdrawal_credential_with_balance(spec, state, validator_index, address=address)
1210

1311
return spec.ConsolidationRequest(

tests/core/pyspec/eth2spec/test/helpers/withdrawals.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ def prepare_pending_withdrawal(spec, state, validator_index,
140140

141141
def prepare_withdrawal_request(spec, state, validator_index, address=None, amount=None):
142142
validator = state.validators[validator_index]
143-
144-
# Set the supplied address or the default one if needed
145-
if address is not None or not spec.has_execution_withdrawal_credential(validator):
143+
if not spec.has_execution_withdrawal_credential(validator):
146144
set_eth1_withdrawal_credential_with_balance(spec, state, validator_index, address=address)
147145

148146
if amount is None:

0 commit comments

Comments
 (0)