# EIP-6110 test plan
* `apply_deposit`, `is_valid_deposit_signature`
- [x] test_process_deposit_new_validator_success, checks:
- new validator record is created with `effective_balance == balance == 0` and other attributes equal to the corresponding `deposit` fields
- new pending deposit is added to `state.pending_deposits`, has `slot == GENESIS_SLOT`, other fields equal to the corresponding `deposit` fields
- [COVERED by [test_process_deposit.py](https://github.com/ethereum/consensus-specs/blob/85b752be5e43a3b462722bd37bbaadc692719f92/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_deposit.py)]
- [x] test_process_deposit_new_validator_invalid_signature, checks:
- no validator record is created
- no pending deposit is added
- [COVERED by [test_process_deposit.py](https://github.com/ethereum/consensus-specs/blob/85b752be5e43a3b462722bd37bbaadc692719f92/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_deposit.py)]
- [x] test_process_deposit_top_up_success, checks:
- new pending deposit is added to `state.pending_deposits`, has `slot == GENESIS_SLOT`, other fields equal to the corresponding `deposit` fields
- [COVERED by [test_process_deposit.py](https://github.com/ethereum/consensus-specs/blob/85b752be5e43a3b462722bd37bbaadc692719f92/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_deposit.py)]
- [x] test_process_deposit_top_up_invalid_signature, checks:
- new pending deposit is added to `state.pending_deposits`, has `slot == GENESIS_SLOT`, other fields equal to the corresponding `deposit` fields
- [COVERED by [test_process_deposit.py](https://github.com/ethereum/consensus-specs/blob/85b752be5e43a3b462722bd37bbaadc692719f92/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_deposit.py)]
* `process_deposit_request`
- [x] test_process_deposit_request_first_call, checks:
- `state.deposit_requests_start_index == deposit.index`
- new pending deposit is added to `state.pending_deposits`, has `slot == state.slot`, other fields equal to the corresponding `deposit` fields
- [COVERED by `test_deposit_transition__start_index_is_set`]
- [x] test_process_deposit_request_subsequent_call, checks:
- `state.deposit_requests_start_index == first_deposit.index`
- [COVERED by `test_deposit_transition__start_index_is_set`]
* `apply_pending_deposit`, `is_valid_deposit_signature`
- [x] test_apply_pending_deposit_switch_to_compounding_success, checks:
- the `validator.withdrawal_credentials` has switched to the compounding creds from `deposit.withdrawal_credentials`
- [COVERED by `test_apply_pending_deposit_switch_to_compounding_not_exited`]
- [x] test_apply_pending_deposit_switch_to_compounding_exited_validator, checks:
- validator withdrawal creds did not switch
- [COVERED by `test_apply_pending_deposit_switch_to_compounding`]
- [x] test_apply_pending_deposit_switch_to_compounding_not_compounding_credentials, checks:
- validator withdrawal creds did not switch
- [x] test_apply_pending_deposit_switch_to_compounding_has_bls_credentials, checks:
- validator withdrawal creds did not switch
- [COVERED by `test_apply_pending_deposit_switch_to_compounding_has_bls`]
- [x] test_apply_pending_deposit_switch_to_compounding_invalid_signature, checks:
- validator withdrawal creds did not switch
- [COVERD by `test_apply_pending_deposit_switch_to_compounding_invalid_sig`]
- [x] test_apply_pending_deposit_with_genesis_fork_version, see [test_ineffective_deposit_with_previous_fork_version](https://github.com/ethereum/consensus-specs/blob/85b752be5e43a3b462722bd37bbaadc692719f92/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_deposit.py#L14)
- [x] test_apply_pending_deposit_with_previous_fork_version, see [test_effective_deposit_with_genesis_fork_version](https://github.com/ethereum/consensus-specs/blob/85b752be5e43a3b462722bd37bbaadc692719f92/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_deposit.py#L31)
- [x] test_new_deposit_under_max, for this and below see [test_process_deposit.py](https://github.com/ethereum/consensus-specs/blob/85b752be5e43a3b462722bd37bbaadc692719f92/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_deposit.py)
- [x] test_new_deposit_max
- [x] test_new_deposit_over_max
- [COVERED by `test_pending_deposit_over_max`]
- [x] test_new_deposit_eth1_withdrawal_credentials
- [x] test_new_deposit_non_versioned_withdrawal_credentials
- [x] test_correct_sig_but_forked_state
- [x] test_incorrect_sig_new_deposit
- [COVERED by `test_apply_pending_deposit_switch_to_compounding_invalid_sig`]
- [x] test_top_up__max_effective_balance
- [x] test_top_up__less_effective_balance
- [x] test_top_up__zero_balance
- [x] test_incorrect_sig_top_up
- [x] test_incorrect_withdrawal_credentials_top_up
- [x] test_key_validate_invalid_subgroup
- [x] test_key_validate_invalid_decompression
- [ ] test_ineffective_deposit_with_bad_fork_version
- [x] test_pending_deposit_min_activation_balance
* `process_pending_deposits`
- [x] test_process_pending_deposits_eth1_bridge_deprecation_1
- scenario: there are pending eth1 bridge deposits (`state.eth1_deposit_index < state.deposit_requests_start_index`)
and there is a deposit in the queue that is coming as a deposit request (`deposit.slot > GENESIS_SLOT`)
there is a couple of eth1 bridge deposits that are processed before the deposit request
- checks: deposit processing stopped, eth1 bridge deposits dequeued, no churn accumulated
- [COVERED by `test_pending_deposit_eth1_bridge_pending`]
- [x] test_process_pending_deposits_eth1_bridge_deprecation_2
- scenario: there are pending eth1 bridge deposits (`state.eth1_deposit_index < state.deposit_requests_start_index`)
the first deposit in the queue is coming as a deposit request (`deposit.slot > GENESIS_SLOT`)
- checks: no deposit is processed, no churn accumulated
- [COVERED by `test_pending_deposit_eth1_bridge_not_applied`]
- [x] test_process_pending_deposits_eth1_bridge_deprecation_3
- scenario: there is no pending eth1 bridge deposits (`state.eth1_deposit_index == state.deposit_requests_start_index`)
the first deposit in the queue is coming as a deposit request (`deposit.slot > GENESIS_SLOT`)
there is a mix of eth1 bridge deposits and deposit requests in the queue
- checks: all deposit are processed
- [COVERD by `test_pending_deposit_no_eth1_bridge_pending`]
- [x] test_process_pending_deposits_are_not_finalized
- scenario: first couple of deposits are finalized, but the next are not
- checks: only finalized deposits are processed, no churn is accumulated
- [COVERED by `test_pending_deposit_not_finalized`]
- [x] test_process_pending_deposits_limit_is_reached
- scenario: more than `MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING` small amount deposits in the queue
- checks: no deposits above the limit are processed, no churn is accumulated
- [x] test_process_pending_deposits_top_up_to_withdrawn_validator
- checks: top up is applied, no churn is consumed
- [COVERED by `test_pending_deposit_validator_withdrawn`, `test_processing_deposit_of_withdrawable_validator`, `test_processing_deposit_of_withdrawable_validator_not_churned`]
- [x] test_process_pending_deposits_top_up_to_exiting_validator (validator exited but not withdrawn):
- scenario: mix of top-ups to exiting and not exiting validators
- check: deposits to the exiting validators are appended to `state.pending_deposits`
- check: deposits are dequeued correctly
- covers: postponing and dequeueing
- [COVERED by `test_pending_deposit_validator_exiting_but_not_withdrawn`, `test_skipped_deposit_exiting_validator`, `test_multiple_skipped_deposits_exiting_validators`, `test_multiple_pending_one_skipped`]
- [x] test_process_pending_deposits_amount_exceedes_churn_top_up
- covers: churn accumulation
- checks: the balance accrues amount eventually, churn is accumulated
- [COVERED by `test_mixture_of_skipped_and_above_churn`]
- [x] test_process_pending_deposits_amount_exceedes_churn_new_validator
- covers: churn accumulation
- checks: the validator is created eventually, churn is accumulated
- [COVERED by `test_pending_deposit_balance_above_churn`]
- [x] test_process_pending_deposits_amount_churn_limit_hit
- scenario: mix of top ups and new validators exceeding the churn limit
- checks: churn is accumulated
- covers: churn accumulation
- [COVERED by `test_multiple_pending_deposits_above_churn`]
- [x] test_pending_deposit_preexisting_churn
- [x] test_pending_deposit_balance_equal_churn
- [x] test_pending_deposit_balance_equal_churn_with_compounding
- [x] test_multiple_pending_deposits_below_churn
* `process_operations`
- [x] `state.eth1_deposit_index < min(state.eth1_data.deposit_count, state.deposit_requests_start_index)`, checks:
- `assert len(body.deposits) == min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index)`
- [COVERED by `test_deposit_transition__process_max_eth1_deposits`, `test_deposit_transition__process_eth1_deposits_up_to_start_index`, `test_deposit_transition__invalid_not_enough_eth1_deposits`]
- [x] `state.eth1_deposit_index >= min(state.eth1_data.deposit_count, state.deposit_requests_start_index)`, checks:
- `assert len(body.deposits) == 0`
- [COVERED by `test_deposit_transition__invalid_too_many_eth1_deposits`, `test_deposit_transition__invalid_eth1_deposits_overlap_in_protocol_deposits`]