forked from polymerdao/eth-consensus-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements parameterised phase1 tests
- Loading branch information
Showing
10 changed files
with
60 additions
and
207 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
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
7 changes: 7 additions & 0 deletions
7
test_libs/pyspec/tests/phase1/block_processing_phase1/test_phase0_block_processing.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,7 @@ | ||
from tests.phase0.block_processing.test_process_attestation import * | ||
from tests.phase0.block_processing.test_process_attester_slashing import * | ||
from tests.phase0.block_processing.test_process_block_header import * | ||
from tests.phase0.block_processing.test_process_deposit import * | ||
from tests.phase0.block_processing.test_process_proposer_slashing import * | ||
from tests.phase0.block_processing.test_process_transfer import * | ||
from tests.phase0.block_processing.test_voluntary_exit import * |
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
2 changes: 2 additions & 0 deletions
2
test_libs/pyspec/tests/phase1/epoch_processing/test_phase0.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,2 @@ | ||
from tests.phase0.epoch_processing.test_process_crosslinks import * | ||
from tests.phase0.epoch_processing.test_process_registry_updates import * |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,27 +1,4 @@ | ||
from copy import deepcopy | ||
|
||
import pytest | ||
|
||
import eth2spec.phase1.spec as spec | ||
|
||
from eth2spec.phase1.spec import ( | ||
state_transition, | ||
) | ||
|
||
from tests.phase0.helpers import ( | ||
build_empty_block_for_next_slot, | ||
fill_aggregate_attestation, | ||
get_current_epoch, | ||
get_epoch_start_slot, | ||
get_valid_attestation, | ||
next_epoch, | ||
) | ||
|
||
from tests.phase0.test_finality import ( | ||
pytestmark, | ||
check_finality, | ||
test_finality_rule_1, | ||
test_finality_rule_2, | ||
test_finality_rule_3, | ||
test_finality_rule_4, | ||
) | ||
from tests.phase0.test_finality import * |
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 |
---|---|---|
@@ -1,68 +1,4 @@ | ||
from copy import deepcopy | ||
|
||
import pytest | ||
|
||
from py_ecc import bls | ||
import eth2spec.phase1.spec as spec | ||
|
||
from eth2spec.utils.minimal_ssz import signing_root | ||
from eth2spec.phase1.spec import ( | ||
# constants | ||
ZERO_HASH, | ||
SLOTS_PER_HISTORICAL_ROOT, | ||
# SSZ | ||
Deposit, | ||
Transfer, | ||
VoluntaryExit, | ||
# functions | ||
get_active_validator_indices, | ||
get_beacon_proposer_index, | ||
get_block_root_at_slot, | ||
get_current_epoch, | ||
get_domain, | ||
process_slot, | ||
verify_merkle_branch, | ||
state_transition, | ||
hash, | ||
) | ||
from eth2spec.utils.merkle_minimal import ( | ||
calc_merkle_tree_from_leaves, | ||
get_merkle_proof, | ||
get_merkle_root, | ||
) | ||
from .helpers import ( | ||
advance_slot, | ||
get_balance, | ||
build_deposit_data, | ||
build_empty_block_for_next_slot, | ||
fill_aggregate_attestation, | ||
get_state_root, | ||
get_valid_attestation, | ||
get_valid_attester_slashing, | ||
get_valid_proposer_slashing, | ||
next_slot, | ||
privkeys, | ||
pubkeys, | ||
) | ||
|
||
|
||
# mark entire file as 'sanity' | ||
pytestmark = pytest.mark.sanity | ||
|
||
from tests.phase0.test_sanity import ( | ||
test_slot_transition, | ||
test_empty_block_transition, | ||
test_skipped_slots, | ||
test_empty_epoch_transition, | ||
test_empty_epoch_transition_not_finalizing, | ||
test_proposer_slashing, | ||
test_attester_slashing, | ||
test_deposit_in_block, | ||
test_deposit_top_up, | ||
test_attestation, | ||
test_voluntary_exit, | ||
test_transfer, | ||
test_balance_driven_status_transitions, | ||
test_historical_batch, | ||
test_eth1_data_votes, | ||
) | ||
from tests.phase0.test_sanity import * |