From f8bb89c8cd54456deccbb98eb091ca018c5842ed Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sat, 5 Mar 2022 16:40:32 -0500 Subject: [PATCH] move lbry.wallet.server.udp -> lbry.wallet.udp --- lbry/utils.py | 2 +- lbry/wallet/network.py | 2 +- lbry/wallet/server/chain_reader.py | 2 +- lbry/wallet/{server => }/udp.py | 2 ++ tests/integration/blockchain/test_network.py | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) rename lbry/wallet/{server => }/udp.py (99%) diff --git a/lbry/utils.py b/lbry/utils.py index a5dc1a26e..edcfbb221 100644 --- a/lbry/utils.py +++ b/lbry/utils.py @@ -405,7 +405,7 @@ async def fallback_get_external_ip(): # used if spv servers can't be used for i async def _get_external_ip(default_servers) -> typing.Tuple[typing.Optional[str], typing.Optional[str]]: # used if upnp is disabled or non-functioning - from lbry.wallet.server.udp import SPVStatusClientProtocol # pylint: disable=C0415 + from lbry.wallet.udp import SPVStatusClientProtocol # pylint: disable=C0415 hostname_to_ip = {} ip_to_hostnames = collections.defaultdict(list) diff --git a/lbry/wallet/network.py b/lbry/wallet/network.py index 3e4906389..27c57dd1b 100644 --- a/lbry/wallet/network.py +++ b/lbry/wallet/network.py @@ -16,7 +16,7 @@ from lbry.utils import resolve_host from lbry.error import IncompatibleWalletServerError from lbry.wallet.rpc import RPCSession as BaseClientSession, Connector, RPCError, ProtocolError from lbry.wallet.stream import StreamController -from lbry.wallet.server.udp import SPVStatusClientProtocol, SPVPong +from lbry.wallet.udp import SPVStatusClientProtocol, SPVPong from lbry.conf import KnownHubsList log = logging.getLogger(__name__) diff --git a/lbry/wallet/server/chain_reader.py b/lbry/wallet/server/chain_reader.py index 6d3229c1b..a08599e5c 100644 --- a/lbry/wallet/server/chain_reader.py +++ b/lbry/wallet/server/chain_reader.py @@ -7,7 +7,7 @@ from prometheus_client import Gauge, Histogram import lbry from lbry.wallet.server.mempool import MemPool from lbry.wallet.server.db.prefixes import DBState -from lbry.wallet.server.udp import StatusServer +from lbry.wallet.udp import StatusServer from lbry.wallet.server.db.db import HubDB from lbry.wallet.server.db.elasticsearch.notifier import ElasticNotifierClientProtocol from lbry.wallet.server.session import LBRYSessionManager diff --git a/lbry/wallet/server/udp.py b/lbry/wallet/udp.py similarity index 99% rename from lbry/wallet/server/udp.py rename to lbry/wallet/udp.py index 06e737521..6396d0b3e 100644 --- a/lbry/wallet/server/udp.py +++ b/lbry/wallet/udp.py @@ -175,9 +175,11 @@ class SPVServerStatusProtocol(asyncio.DatagramProtocol): class StatusServer: def __init__(self): + 1/0 self._protocol: Optional[SPVServerStatusProtocol] = None async def start(self, height: int, tip: bytes, country: str, interface: str, port: int, allow_lan: bool = False): + 1/0 if self.is_running: return loop = asyncio.get_event_loop() diff --git a/tests/integration/blockchain/test_network.py b/tests/integration/blockchain/test_network.py index 70cea31ad..2a88e9dad 100644 --- a/tests/integration/blockchain/test_network.py +++ b/tests/integration/blockchain/test_network.py @@ -9,7 +9,7 @@ from lbry.wallet.network import Network from lbry.wallet.orchstr8 import Conductor from lbry.wallet.orchstr8.node import SPVNode from lbry.wallet.rpc import RPCSession -from lbry.wallet.server.udp import StatusServer +from lbry.wallet.udp import StatusServer from lbry.testcase import IntegrationTestCase, AsyncioTestCase from lbry.conf import Config