Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
Use clearer name on auxillary helper imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Jul 2, 2019
1 parent e6e6d01 commit 2dfbc62
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/plugins/eth2/beacon/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
create_mock_genesis,
)

helpers = importlib.import_module('tests.core.p2p-proto.bcc.helpers')
bcc_helpers = importlib.import_module('tests.core.p2p-proto.bcc.helpers')


NUM_VALIDATORS = 8
Expand Down
17 changes: 9 additions & 8 deletions tests/plugins/eth2/beacon/test_receive_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,17 @@
)

from .helpers import (
helpers,
bcc_helpers
)


from eth2.beacon.types.attestations import (
default_attestation,
)


class FakeChain(_TestnetChain):
chaindb_class = helpers.FakeAsyncBeaconChainDB
class FakeChain(TestnetChain):
chaindb_class = bcc_helpers.FakeAsyncBeaconChainDB

def import_block(
self,
Expand All @@ -96,7 +97,7 @@ def import_block(

async def get_fake_chain() -> FakeChain:
genesis_config = Eth2GenesisConfig(XIAO_LONG_BAO_CONFIG)
chain_db = await helpers.get_genesis_chain_db(genesis_config=genesis_config)
chain_db = await bcc_helpers.get_genesis_chain_db(genesis_config=genesis_config)
return FakeChain(base_db=chain_db.db, genesis_config=genesis_config)


Expand Down Expand Up @@ -126,7 +127,7 @@ async def get_peer_and_receive_server(request, event_loop, event_bus) -> Tuple[

(
alice, alice_peer_pool, bob, bob_peer_pool
) = await helpers.get_directly_linked_peers_in_peer_pools(
) = await bcc_helpers.get_directly_linked_peers_in_peer_pools(
request,
event_loop,
alice_chain_db=alice_chain.chaindb,
Expand Down Expand Up @@ -169,9 +170,9 @@ def finalizer():

def test_orphan_block_pool():
pool = OrphanBlockPool()
b0 = helpers.create_test_block()
b1 = helpers.create_test_block(parent=b0)
b2 = helpers.create_test_block(parent=b0, state_root=b"\x11" * 32)
b0 = bcc_helpers.create_test_block()
b1 = bcc_helpers.create_test_block(parent=b0)
b2 = bcc_helpers.create_test_block(parent=b0, state_root=b"\x11" * 32)
# test: add
pool.add(b1)
assert b1 in pool._pool
Expand Down
4 changes: 2 additions & 2 deletions tests/plugins/eth2/beacon/test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from .helpers import (
genesis_block,
genesis_state,
helpers,
bcc_helpers,
index_to_pubkey,
keymap,
)
Expand Down Expand Up @@ -91,7 +91,7 @@ def get_chain_from_genesis(db, indices):


async def get_validator(event_loop, event_bus, indices) -> Validator:
chain_db = await helpers.get_chain_db()
chain_db = await bcc_helpers.get_chain_db()
chain = get_chain_from_genesis(chain_db.db, indices)
peer_pool = FakePeerPool()
validator_privkeys = {
Expand Down

0 comments on commit 2dfbc62

Please sign in to comment.