update imports to new helpers + fix up imports

This commit is contained in:
protolambda 2019-05-15 18:45:25 +02:00
parent a4e22639f3
commit e07f1bc98f
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
10 changed files with 24 additions and 48 deletions

View File

@ -1,24 +1,24 @@
from copy import deepcopy
import eth2spec.phase0.spec as spec
from eth2spec.phase0.state_transition import (
state_transition_to,
)
from eth2spec.phase0.spec import (
get_current_epoch,
process_attestation
)
from eth2spec.test.helpers import (
from eth2spec.phase0.state_transition import (
state_transition_to,
)
from eth2spec.test.context import spec_state_test, expect_assertion_error
from eth2spec.test.helpers.attestations import (
get_valid_attestation,
make_attestation_signature,
)
from eth2spec.test.helpers.state import (
apply_empty_block,
next_epoch,
next_slot,
make_attestation_signature,
)
from eth2spec.test.context import spec_state_test, expect_assertion_error
def run_attestation_processing(state, attestation, valid=True):
"""

View File

@ -4,12 +4,12 @@ from eth2spec.phase0.spec import (
process_attester_slashing,
)
from eth2spec.test.context import spec_state_test, expect_assertion_error
from eth2spec.test.helpers import (
from eth2spec.test.helpers.attestations import make_indexed_attestation_signature
from eth2spec.test.helpers.attester_slashings import get_valid_attester_slashing
from eth2spec.test.helpers.state import (
get_balance,
get_valid_attester_slashing,
next_epoch,
apply_empty_block,
make_indexed_attestation_signature
)

View File

@ -7,11 +7,11 @@ from eth2spec.phase0.spec import (
process_block_header,
)
from eth2spec.test.context import spec_state_test, expect_assertion_error
from eth2spec.test.helpers import (
from eth2spec.test.helpers.block import (
build_empty_block_for_next_slot,
next_slot,
make_block_signature
)
from eth2spec.test.helpers.state import next_slot
def prepare_state_for_header_processing(state):

View File

@ -1,18 +1,8 @@
import eth2spec.phase0.spec as spec
from eth2spec.phase0.spec import (
ZERO_HASH,
process_deposit,
)
from eth2spec.test.helpers import (
get_balance,
build_deposit,
prepare_state_and_deposit,
privkeys,
pubkeys,
)
from eth2spec.phase0.spec import process_deposit
from eth2spec.test.context import spec_state_test, expect_assertion_error
from eth2spec.test.helpers.deposits import prepare_state_and_deposit
from eth2spec.test.helpers.state import get_balance
def run_deposit_processing(state, deposit, validator_index, valid=True):

View File

@ -3,12 +3,9 @@ from eth2spec.phase0.spec import (
get_current_epoch,
process_proposer_slashing,
)
from eth2spec.test.helpers import (
get_balance,
get_valid_proposer_slashing,
)
from eth2spec.test.context import spec_state_test, expect_assertion_error
from eth2spec.test.helpers.proposer_slashings import get_valid_proposer_slashing
from eth2spec.test.helpers.state import get_balance
def run_proposer_slashing_processing(state, proposer_slashing, valid=True):

View File

@ -6,11 +6,8 @@ from eth2spec.phase0.spec import (
process_transfer,
)
from eth2spec.test.context import spec_state_test, expect_assertion_error
from eth2spec.test.helpers import (
get_valid_transfer,
next_epoch,
apply_empty_block
)
from eth2spec.test.helpers.state import next_epoch, apply_empty_block
from eth2spec.test.helpers.transfers import get_valid_transfer
def run_transfer_processing(state, transfer, valid=True):

View File

@ -1,17 +1,13 @@
import eth2spec.phase0.spec as spec
from eth2spec.phase0.spec import (
get_active_validator_indices,
get_churn_limit,
get_current_epoch,
process_voluntary_exit,
)
from eth2spec.test.helpers import (
build_voluntary_exit,
pubkey_to_privkey,
)
from eth2spec.test.context import spec_state_test, expect_assertion_error
from eth2spec.test.helpers.keys import pubkey_to_privkey
from eth2spec.test.helpers.voluntary_exits import build_voluntary_exit
def run_voluntary_exit_processing(state, voluntary_exit, valid=True):

View File

@ -2,14 +2,12 @@ from typing import List
# Access constants from spec pkg reference.
import eth2spec.phase0.spec as spec
from eth2spec.phase0.spec import (
Attestation,
AttestationData,
AttestationDataAndCustodyBit,
get_epoch_start_slot, get_block_root, get_current_epoch, get_previous_epoch, slot_to_epoch, get_shard_delta,
get_crosslink_committee, get_domain, IndexedAttestation, get_attesting_indices, BeaconState, get_block_root_at_slot)
from eth2spec.phase0.state_transition import (
state_transition, state_transition_to
)

View File

@ -1,8 +1,7 @@
from eth2spec.phase0 import spec
from eth2spec.phase0.spec import get_beacon_proposer_index, slot_to_epoch, get_domain, BeaconBlock
from copy import deepcopy
from eth2spec.phase0 import spec
from eth2spec.phase0.spec import get_beacon_proposer_index, slot_to_epoch, get_domain, BeaconBlock
from eth2spec.test.helpers.keys import privkeys
from eth2spec.test.helpers.state import next_slot
from eth2spec.utils.bls import bls_sign

View File

@ -2,7 +2,6 @@ from copy import deepcopy
# Access constants from spec pkg reference.
import eth2spec.phase0.spec as spec
from eth2spec.phase0.spec import get_current_epoch, get_active_validator_indices, BeaconBlockHeader, ZERO_HASH, \
get_domain, ProposerSlashing
from eth2spec.test.helpers.keys import pubkey_to_privkey