enhance exit queue test

This commit is contained in:
Danny Ryan 2019-04-14 09:21:29 +10:00
parent 37004404d0
commit bade9ff3ed
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A

View File

@ -76,7 +76,11 @@ def test_success_exit_queue(state):
privkey,
)
_, post_state = run_voluntary_exit_processing(post_state, voluntary_exit)
pre_state, post_state = run_voluntary_exit_processing(post_state, voluntary_exit)
assert post_state.exit_queue_filled > pre_state.exit_queue_filled
assert post_state.exit_epoch >= pre_state.exit_epoch
assert post_state.exit_epoch == pre_state.exit_epoch
# exit an additional validator
validator_index = get_active_validator_indices(state.validator_registry,current_epoch)[-1]
@ -94,6 +98,9 @@ def test_success_exit_queue(state):
post_state.validator_registry[validator_index].exit_epoch ==
post_state.validator_registry[initial_indices[0]].exit_epoch + 1
)
assert post_state.exit_queue_filled == 1
assert post_state.exit_epoch == pre_state.exit_epoch + 1
return pre_state, voluntary_exit, post_state