Move yield pre-state after state setup
This commit is contained in:
parent
7df1ce3038
commit
745b4dd3db
|
@ -28,13 +28,13 @@ def test_basic_el_withdrawal_request(spec, state):
|
||||||
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
state.slot += spec.config.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
state.slot += spec.config.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
|
|
||||||
yield 'pre', state
|
|
||||||
|
|
||||||
validator_index = 0
|
validator_index = 0
|
||||||
address = b'\x22' * 20
|
address = b'\x22' * 20
|
||||||
set_eth1_withdrawal_credential_with_balance(spec, state, validator_index, address=address)
|
set_eth1_withdrawal_credential_with_balance(spec, state, validator_index, address=address)
|
||||||
assert state.validators[validator_index].exit_epoch == spec.FAR_FUTURE_EPOCH
|
assert state.validators[validator_index].exit_epoch == spec.FAR_FUTURE_EPOCH
|
||||||
|
|
||||||
|
yield 'pre', state
|
||||||
|
|
||||||
validator_pubkey = state.validators[validator_index].pubkey
|
validator_pubkey = state.validators[validator_index].pubkey
|
||||||
withdrawal_request = spec.WithdrawalRequest(
|
withdrawal_request = spec.WithdrawalRequest(
|
||||||
source_address=address,
|
source_address=address,
|
||||||
|
@ -57,10 +57,11 @@ def test_basic_btec_and_el_withdrawal_request_in_same_block(spec, state):
|
||||||
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
state.slot += spec.config.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
state.slot += spec.config.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
|
|
||||||
yield 'pre', state
|
|
||||||
validator_index = 0
|
validator_index = 0
|
||||||
assert state.validators[validator_index].exit_epoch == spec.FAR_FUTURE_EPOCH
|
assert state.validators[validator_index].exit_epoch == spec.FAR_FUTURE_EPOCH
|
||||||
|
|
||||||
|
yield 'pre', state
|
||||||
|
|
||||||
block = build_empty_block_for_next_slot(spec, state)
|
block = build_empty_block_for_next_slot(spec, state)
|
||||||
|
|
||||||
address = b'\x22' * 20
|
address = b'\x22' * 20
|
||||||
|
@ -99,11 +100,11 @@ def test_basic_btec_before_el_withdrawal_request(spec, state):
|
||||||
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
state.slot += spec.config.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
state.slot += spec.config.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
|
|
||||||
yield 'pre', state
|
|
||||||
|
|
||||||
validator_index = 0
|
validator_index = 0
|
||||||
assert state.validators[validator_index].exit_epoch == spec.FAR_FUTURE_EPOCH
|
assert state.validators[validator_index].exit_epoch == spec.FAR_FUTURE_EPOCH
|
||||||
|
|
||||||
|
yield 'pre', state
|
||||||
|
|
||||||
# block_1 contains a BTEC operation of the given validator
|
# block_1 contains a BTEC operation of the given validator
|
||||||
address = b'\x22' * 20
|
address = b'\x22' * 20
|
||||||
signed_address_change = get_signed_address_change(
|
signed_address_change = get_signed_address_change(
|
||||||
|
@ -146,13 +147,13 @@ def test_cl_exit_and_el_withdrawal_request_in_same_block(spec, state):
|
||||||
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
|
||||||
state.slot += spec.config.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
state.slot += spec.config.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
|
||||||
|
|
||||||
yield 'pre', state
|
|
||||||
|
|
||||||
validator_index = 0
|
validator_index = 0
|
||||||
address = b'\x22' * 20
|
address = b'\x22' * 20
|
||||||
set_eth1_withdrawal_credential_with_balance(spec, state, validator_index, address=address)
|
set_eth1_withdrawal_credential_with_balance(spec, state, validator_index, address=address)
|
||||||
assert state.validators[validator_index].exit_epoch == spec.FAR_FUTURE_EPOCH
|
assert state.validators[validator_index].exit_epoch == spec.FAR_FUTURE_EPOCH
|
||||||
|
|
||||||
|
yield 'pre', state
|
||||||
|
|
||||||
# CL-Exit
|
# CL-Exit
|
||||||
signed_voluntary_exits = prepare_signed_exits(spec, state, indices=[validator_index])
|
signed_voluntary_exits = prepare_signed_exits(spec, state, indices=[validator_index])
|
||||||
# EL-Exit
|
# EL-Exit
|
||||||
|
|
Loading…
Reference in New Issue