-
Notifications
You must be signed in to change notification settings - Fork 972
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add @description decorator * Unify test case naming style * more clean ups * Altair tests cleanup * Clean up Altair and Bellatrix `process_deposit` tests * Clean up Bellatrix tests * Clean up Capella tests * PR feedback from @ralexstokes * Add comments on the deposit fork version tests * Remove `test_incorrect_sig_other_version` since it is duplicate to `test_ineffective_deposit_with_bad_fork_version` * Add `test_ineffective_deposit_with_current_fork_version`
- Loading branch information
Showing
22 changed files
with
352 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
tests/core/pyspec/eth2spec/test/altair/block_processing/test_process_deposit.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from eth2spec.test.context import ( | ||
spec_state_test, | ||
always_bls, | ||
with_phases, | ||
with_altair_and_later, | ||
) | ||
from eth2spec.test.helpers.constants import ( | ||
ALTAIR, | ||
) | ||
|
||
|
||
from eth2spec.test.helpers.deposits import ( | ||
run_deposit_processing_with_specific_fork_version, | ||
) | ||
|
||
|
||
@with_phases([ALTAIR]) | ||
@spec_state_test | ||
@always_bls | ||
def test_effective_deposit_with_previous_fork_version(spec, state): | ||
assert state.fork.previous_version != state.fork.current_version | ||
|
||
# It's only effective in Altair because the default `fork_version` of `compute_domain` is `GENESIS_FORK_VERSION`. | ||
# Therefore it's just a normal `DepositMessage`. | ||
yield from run_deposit_processing_with_specific_fork_version( | ||
spec, | ||
state, | ||
fork_version=state.fork.previous_version, | ||
) | ||
|
||
|
||
@with_altair_and_later | ||
@spec_state_test | ||
@always_bls | ||
def test_ineffective_deposit_with_current_fork_version(spec, state): | ||
yield from run_deposit_processing_with_specific_fork_version( | ||
spec, | ||
state, | ||
fork_version=state.fork.current_version, | ||
effective=False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.