adding out of validator range test
This commit is contained in:
parent
320a692bec
commit
48b9928194
|
@ -17,6 +17,8 @@ def run_process_pending_deposits(spec, state):
|
||||||
spec, state, 'process_pending_deposits')
|
spec, state, 'process_pending_deposits')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@with_electra_and_later
|
@with_electra_and_later
|
||||||
@spec_state_test
|
@spec_state_test
|
||||||
def test_pending_deposit_over_max(spec, state):
|
def test_pending_deposit_over_max(spec, state):
|
||||||
|
@ -174,6 +176,37 @@ def test_pending_deposit_validator_exiting_but_not_withdrawn(spec, state):
|
||||||
assert len(state.pending_deposits) == 1
|
assert len(state.pending_deposits) == 1
|
||||||
|
|
||||||
|
|
||||||
|
@with_electra_and_later
|
||||||
|
@spec_state_test
|
||||||
|
def test_pending_deposit_not_in_validator_set(spec, state):
|
||||||
|
index = 2000
|
||||||
|
amount = spec.MIN_ACTIVATION_BALANCE
|
||||||
|
withdrawal_credentials = (
|
||||||
|
spec.ETH1_ADDRESS_WITHDRAWAL_PREFIX +
|
||||||
|
spec.hash(pubkeys[index])[1:]
|
||||||
|
)
|
||||||
|
deposit_data = build_deposit_data(spec,
|
||||||
|
pubkeys[index],
|
||||||
|
privkeys[index],
|
||||||
|
amount,
|
||||||
|
withdrawal_credentials,
|
||||||
|
signed=True)
|
||||||
|
state.pending_deposits.append(spec.PendingDeposit(
|
||||||
|
pubkey=pubkeys[index],
|
||||||
|
withdrawal_credentials=withdrawal_credentials,
|
||||||
|
amount=amount,
|
||||||
|
slot=spec.GENESIS_SLOT,
|
||||||
|
signature=deposit_data.signature,
|
||||||
|
))
|
||||||
|
value_error = False
|
||||||
|
try:
|
||||||
|
yield from run_process_pending_deposits(spec, state)
|
||||||
|
except ValueError:
|
||||||
|
value_error = True
|
||||||
|
|
||||||
|
assert value_error
|
||||||
|
|
||||||
|
|
||||||
@with_electra_and_later
|
@with_electra_and_later
|
||||||
@spec_state_test
|
@spec_state_test
|
||||||
def test_pending_deposit_min_activation_balance(spec, state):
|
def test_pending_deposit_min_activation_balance(spec, state):
|
||||||
|
|
Loading…
Reference in New Issue