Skip to content

Commit

Permalink
Remove test_incorrect_sig_other_version since it is duplicate to `t…
Browse files Browse the repository at this point in the history
…est_ineffective_deposit_with_bad_fork_version`
  • Loading branch information
hwwhww committed Dec 8, 2022
1 parent 34907d2 commit 847c2bf
Showing 1 changed file with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from eth2spec.test.context import spec_state_test, always_bls, with_all_phases
from eth2spec.test.helpers.deposits import (
build_deposit,
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
from eth2spec.utils import bls


@with_all_phases
Expand Down Expand Up @@ -90,33 +88,6 @@ def test_new_deposit_non_versioned_withdrawal_credentials(spec, state):
yield from run_deposit_processing(spec, state, deposit, validator_index)


@with_all_phases
@spec_state_test
@always_bls
def test_incorrect_sig_other_version(spec, state):
validator_index = len(state.validators)
amount = spec.MAX_EFFECTIVE_BALANCE

pubkey = pubkeys[validator_index]
privkey = privkeys[validator_index]
withdrawal_credentials = spec.BLS_WITHDRAWAL_PREFIX + spec.hash(pubkey)[1:]

# Go through the effort of manually signing, not something normally done. This sig domain will be invalid.
deposit_message = spec.DepositMessage(pubkey=pubkey, withdrawal_credentials=withdrawal_credentials, amount=amount)
domain = spec.compute_domain(domain_type=spec.DOMAIN_DEPOSIT, fork_version=spec.Version('0xaabbccdd'))
deposit_data = spec.DepositData(
pubkey=pubkey, withdrawal_credentials=withdrawal_credentials, amount=amount,
signature=bls.Sign(privkey, spec.compute_signing_root(deposit_message, domain))
)
deposit, root, _ = deposit_from_context(spec, [deposit_data], 0)

state.eth1_deposit_index = 0
state.eth1_data.deposit_root = root
state.eth1_data.deposit_count = 1

yield from run_deposit_processing(spec, state, deposit, validator_index, effective=False)


@with_all_phases
@spec_state_test
@always_bls
Expand Down

0 comments on commit 847c2bf

Please sign in to comment.