From d11189b3a0ca487d26a7ed579af7b35bb289302b Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Thu, 8 Dec 2022 16:15:08 +0800 Subject: [PATCH] PR feedback from @ralexstokes --- .../block_processing/test_process_deposit.py | 14 ------------- .../block_processing/test_process_deposit.py | 1 - .../block_processing/test_process_deposit.py | 21 +++++++++++++++---- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/altair/block_processing/test_process_deposit.py b/tests/core/pyspec/eth2spec/test/altair/block_processing/test_process_deposit.py index ac728d4cc3..f7f468b367 100644 --- a/tests/core/pyspec/eth2spec/test/altair/block_processing/test_process_deposit.py +++ b/tests/core/pyspec/eth2spec/test/altair/block_processing/test_process_deposit.py @@ -1,7 +1,6 @@ from eth2spec.test.context import ( spec_state_test, always_bls, - with_altair_and_later, with_phases, ) from eth2spec.test.helpers.constants import ( @@ -24,17 +23,4 @@ def test_effective_deposit_with_previous_fork_version(spec, state): spec, state, fork_version=state.fork.previous_version, - effective=True, - ) - - -@with_altair_and_later -@spec_state_test -@always_bls -def test_ineffective_deposit_with_bad_fork_version_and(spec, state): - yield from run_deposit_processing_with_specific_fork_version( - spec, - state, - fork_version=spec.Version('0xAaBbCcDd'), - effective=False, ) diff --git a/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_deposit.py b/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_deposit.py index 6473b7de65..24c94bac68 100644 --- a/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_deposit.py +++ b/tests/core/pyspec/eth2spec/test/bellatrix/block_processing/test_process_deposit.py @@ -33,5 +33,4 @@ def test_effective_deposit_with_genesis_fork_version(spec, state): spec, state, fork_version=spec.config.GENESIS_FORK_VERSION, - effective=True, ) diff --git a/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_deposit.py b/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_deposit.py index e464cd9d78..a7e2f8aa92 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_deposit.py +++ b/tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_deposit.py @@ -4,6 +4,7 @@ deposit_from_context, prepare_state_and_deposit, run_deposit_processing, + run_deposit_processing_with_specific_fork_version, sign_deposit_data, ) from eth2spec.test.helpers.keys import privkeys, pubkeys @@ -92,7 +93,7 @@ def test_new_deposit_non_versioned_withdrawal_credentials(spec, state): @with_all_phases @spec_state_test @always_bls -def test_invalid_sig_other_version(spec, state): +def test_incorrect_sig_other_version(spec, state): validator_index = len(state.validators) amount = spec.MAX_EFFECTIVE_BALANCE @@ -125,7 +126,7 @@ def test_correct_sig_but_forked_state(spec, state): # deposits will always be valid, regardless of the current fork state.fork.current_version = spec.Version('0x1234abcd') deposit = prepare_state_and_deposit(spec, state, validator_index, amount, signed=True) - yield from run_deposit_processing(spec, state, deposit, validator_index, effective=True) + yield from run_deposit_processing(spec, state, deposit, validator_index) @with_all_phases @@ -202,7 +203,7 @@ def test_incorrect_sig_top_up(spec, state): deposit = prepare_state_and_deposit(spec, state, validator_index, amount) # invalid signatures, in top-ups, are allowed! - yield from run_deposit_processing(spec, state, deposit, validator_index, effective=True) + yield from run_deposit_processing(spec, state, deposit, validator_index) @with_all_phases @@ -220,7 +221,7 @@ def test_incorrect_withdrawal_credentials_top_up(spec, state): ) # inconsistent withdrawal credentials, in top-ups, are allowed! - yield from run_deposit_processing(spec, state, deposit, validator_index, effective=True) + yield from run_deposit_processing(spec, state, deposit, validator_index) @with_all_phases @@ -307,3 +308,15 @@ def test_key_validate_invalid_decompression(spec, state): deposit = prepare_state_and_deposit(spec, state, validator_index, amount, pubkey=pubkey, signed=True) yield from run_deposit_processing(spec, state, deposit, validator_index) + + +@with_all_phases +@spec_state_test +@always_bls +def test_ineffective_deposit_with_bad_fork_version_and(spec, state): + yield from run_deposit_processing_with_specific_fork_version( + spec, + state, + fork_version=spec.Version('0xAaBbCcDd'), + effective=False, + )