updated imports after moving lbrynet -> lbry

This commit is contained in:
Lex Berezhny 2019-06-20 21:02:58 -04:00
parent 063335377e
commit f5e38f6e23
72 changed files with 226 additions and 226 deletions

View file

@ -112,7 +112,7 @@ jobs:
working_dir: dist working_dir: dist
paths: paths:
- lbrynet-${OS}.zip - lbrynet-${OS}.zip
# artifact uploader thinks lbrynet is a directory, https://github.com/travis-ci/artifacts/issues/78 # artifact uploader thinks lbry is a directory, https://github.com/travis-ci/artifacts/issues/78
target_paths: target_paths:
- /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG}) - /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})

View file

@ -1,4 +1,4 @@
__name__ = "lbrynet" __name__ = "lbry"
__version__ = "0.38.0rc7" __version__ = "0.38.0rc7"
version = tuple(__version__.split('.')) version = tuple(__version__.split('.'))

View file

@ -16,7 +16,7 @@ class ComponentType(type):
class Component(metaclass=ComponentType): class Component(metaclass=ComponentType):
""" """
lbrynet-daemon component helper lbry-daemon component helper
Inheriting classes will be automatically registered with the ComponentManager and must implement setup and stop Inheriting classes will be automatically registered with the ComponentManager and must implement setup and stop
methods methods

View file

@ -965,7 +965,7 @@ class Daemon(metaclass=JSONRPCServerType):
Returns: Returns:
(dict) Dictionary of daemon settings (dict) Dictionary of daemon settings
See ADJUSTABLE_SETTINGS in lbrynet/conf.py for full list of settings See ADJUSTABLE_SETTINGS in lbry/conf.py for full list of settings
""" """
return self.conf.settings_dict return self.conf.settings_dict

View file

@ -66,9 +66,9 @@ class CommandTestCase(IntegrationTestCase):
async def asyncSetUp(self): async def asyncSetUp(self):
await super().asyncSetUp() await super().asyncSetUp()
logging.getLogger('lbrynet.blob_exchange').setLevel(self.VERBOSITY) logging.getLogger('lbry.blob_exchange').setLevel(self.VERBOSITY)
logging.getLogger('lbrynet.daemon').setLevel(self.VERBOSITY) logging.getLogger('lbry.daemon').setLevel(self.VERBOSITY)
logging.getLogger('lbrynet.stream').setLevel(self.VERBOSITY) logging.getLogger('lbry.stream').setLevel(self.VERBOSITY)
self.daemons = [] self.daemons = []
self.extra_wallet_nodes = [] self.extra_wallet_nodes = []

View file

@ -4,7 +4,7 @@ __node_bin__ = ''
__node_url__ = ( __node_url__ = (
'https://github.com/lbryio/lbrycrd/releases/download/v0.12.4.0/lbrycrd-linux.zip' 'https://github.com/lbryio/lbrycrd/releases/download/v0.12.4.0/lbrycrd-linux.zip'
) )
__spvserver__ = 'lbrynet.wallet.server.coin.LBCRegTest' __spvserver__ = 'lbry.wallet.server.coin.LBCRegTest'
from lbry.wallet.manager import LbryWalletManager from lbry.wallet.manager import LbryWalletManager
from lbry.wallet.network import Network from lbry.wallet.network import Network

View file

@ -232,7 +232,7 @@ class Resolver:
# these results can include those where `signature_is_valid` is False. if they are skipped, # these results can include those where `signature_is_valid` is False. if they are skipped,
# page indexing becomes tricky, as the number of results isn't known until after having # page indexing becomes tricky, as the number of results isn't known until after having
# processed them. # processed them.
# TODO: fix ^ in lbrynet.schema # TODO: fix ^ in lbry.schema
async def iter_validate_channel_claims(): async def iter_validate_channel_claims():
formatted_claims = [] formatted_claims = []

View file

@ -154,7 +154,7 @@ class LBRYElectrumX(ElectrumX):
return result return result
def format_claim_from_daemon(self, claim, name=None): def format_claim_from_daemon(self, claim, name=None):
"""Changes the returned claim data to the format expected by lbrynet and adds missing fields.""" """Changes the returned claim data to the format expected by lbry and adds missing fields."""
if not claim: if not claim:
return {} return {}

View file

@ -2,9 +2,9 @@ import sys
import asyncio import asyncio
from binascii import hexlify from binascii import hexlify
from lbrynet.wallet.server.db import SQLDB from lbry.wallet.server.db import SQLDB
from lbrynet.wallet.server.coin import LBC from lbry.wallet.server.coin import LBC
from lbrynet.wallet.server.daemon import Daemon from lbry.wallet.server.daemon import Daemon
def hex_reverted(value: bytes) -> str: def hex_reverted(value: bytes) -> str:

View file

@ -1,8 +1,8 @@
import curses import curses
import time import time
import asyncio import asyncio
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.extras.daemon.client import daemon_rpc from lbry.extras.daemon.client import daemon_rpc
stdscr = curses.initscr() stdscr = curses.initscr()

View file

@ -3,13 +3,13 @@ import os
import asyncio import asyncio
import socket import socket
import ipaddress import ipaddress
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.extras.daemon.storage import SQLiteStorage from lbry.extras.daemon.storage import SQLiteStorage
from lbrynet.blob.blob_manager import BlobManager from lbry.blob.blob_manager import BlobManager
from lbrynet.blob_exchange.client import BlobExchangeClientProtocol, request_blob from lbry.blob_exchange.client import BlobExchangeClientProtocol, request_blob
import logging import logging
log = logging.getLogger("lbrynet") log = logging.getLogger("lbry")
log.addHandler(logging.StreamHandler()) log.addHandler(logging.StreamHandler())
log.setLevel(logging.DEBUG) log.setLevel(logging.DEBUG)

View file

@ -8,14 +8,14 @@ import time
from docopt import docopt from docopt import docopt
from binascii import unhexlify from binascii import unhexlify
from textwrap import indent from textwrap import indent
from lbrynet.extras.cli import set_kwargs, get_argument_parser from lbry.extras.cli import set_kwargs, get_argument_parser
from lbrynet.extras.daemon.Daemon import ( from lbry.extras.daemon.Daemon import (
Daemon, jsonrpc_dumps_pretty, encode_pagination_doc Daemon, jsonrpc_dumps_pretty, encode_pagination_doc
) )
from lbrynet.extras.daemon.json_response_encoder import ( from lbry.extras.daemon.json_response_encoder import (
encode_tx_doc, encode_txo_doc, encode_account_doc, encode_file_doc encode_tx_doc, encode_txo_doc, encode_account_doc, encode_file_doc
) )
from lbrynet.testcase import CommandTestCase from lbry.testcase import CommandTestCase
RETURN_DOCS = { RETURN_DOCS = {

View file

@ -137,7 +137,7 @@ class Version:
def release(args): def release(args):
gh = get_github() gh = get_github()
repo = gh.repository('lbryio', 'lbry') repo = gh.repository('lbryio', 'lbry')
version_file = repo.file_contents('lbrynet/__init__.py') version_file = repo.file_contents('lbry/__init__.py')
current_version = Version.from_content(version_file) current_version = Version.from_content(version_file)
print(f'Current Version: {current_version}') print(f'Current Version: {current_version}')

View file

@ -1,7 +1,7 @@
import os import os
import binascii import binascii
import sqlite3 import sqlite3
from lbrynet.conf import Config from lbry.conf import Config
def main(): def main():

View file

@ -23,7 +23,7 @@ def get_build_type(travis_tag=None):
def main(): def main():
root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
build_type_path = os.path.join(root_dir, 'lbrynet', 'build_type.py') build_type_path = os.path.join(root_dir, 'lbry', 'build_type.py')
log.debug("configuring build type file: %s", build_type_path) log.debug("configuring build type file: %s", build_type_path)
travis_commit = os.environ['TRAVIS_COMMIT'][:6] travis_commit = os.environ['TRAVIS_COMMIT'][:6]
build_type = get_build_type(os.environ.get('TRAVIS_TAG', None)) build_type = get_build_type(os.environ.get('TRAVIS_TAG', None))

View file

@ -1,10 +1,10 @@
import sys import sys
import os import os
import asyncio import asyncio
from lbrynet.blob.blob_manager import BlobManager from lbry.blob.blob_manager import BlobManager
from lbrynet.blob_exchange.server import BlobServer from lbry.blob_exchange.server import BlobServer
from lbrynet.schema.address import decode_address from lbry.schema.address import decode_address
from lbrynet.extras.daemon.storage import SQLiteStorage from lbry.extras.daemon.storage import SQLiteStorage
async def main(address: str): async def main(address: str):

View file

@ -6,12 +6,12 @@ import aiohttp
import time import time
from aiohttp import ClientConnectorError from aiohttp import ClientConnectorError
from lbrynet import __version__ from lbry import __version__
from lbrynet.blob.blob_file import MAX_BLOB_SIZE from lbry.blob.blob_file import MAX_BLOB_SIZE
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.schema.uri import parse_lbry_uri from lbry.schema.uri import parse_lbry_uri
from lbrynet.extras.daemon.client import daemon_rpc from lbry.extras.daemon.client import daemon_rpc
from lbrynet.extras import system_info from lbry.extras import system_info
def extract_uris(response): def extract_uris(response):

View file

@ -1,5 +1,5 @@
import os import os
from lbrynet import __name__, __version__ from lbry import __name__, __version__
from setuptools import setup, find_packages from setuptools import setup, find_packages
BASE = os.path.dirname(__file__) BASE = os.path.dirname(__file__)
@ -20,7 +20,7 @@ setup(
packages=find_packages(exclude=('tests',)), packages=find_packages(exclude=('tests',)),
zip_safe=False, zip_safe=False,
entry_points={ entry_points={
'console_scripts': 'lbrynet=lbrynet.extras.cli:main' 'console_scripts': 'lbrynet=lbry.extras.cli:main'
}, },
install_requires=[ install_requires=[
'torba', 'torba',

View file

@ -5,7 +5,7 @@ from unittest import mock
import functools import functools
import asyncio import asyncio
if typing.TYPE_CHECKING: if typing.TYPE_CHECKING:
from lbrynet.dht.protocol.protocol import KademliaProtocol from lbry.dht.protocol.protocol import KademliaProtocol
def get_time_accelerator(loop: asyncio.BaseEventLoop, def get_time_accelerator(loop: asyncio.BaseEventLoop,

View file

@ -1,4 +1,4 @@
from lbrynet.testcase import CommandTestCase from lbry.testcase import CommandTestCase
class AccountManagement(CommandTestCase): class AccountManagement(CommandTestCase):

View file

@ -1,4 +1,4 @@
from lbrynet.testcase import CommandTestCase from lbry.testcase import CommandTestCase
class EpicAdventuresOfChris45(CommandTestCase): class EpicAdventuresOfChris45(CommandTestCase):

View file

@ -7,8 +7,8 @@ from urllib.request import urlopen
from torba.client.errors import InsufficientFundsError from torba.client.errors import InsufficientFundsError
from lbrynet.testcase import CommandTestCase from lbry.testcase import CommandTestCase
from lbrynet.wallet.transaction import Transaction from lbry.wallet.transaction import Transaction
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -2,14 +2,14 @@ import contextlib
from io import StringIO from io import StringIO
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.extras import cli from lbry.extras import cli
from lbrynet.extras.daemon.Components import ( from lbry.extras.daemon.Components import (
DATABASE_COMPONENT, BLOB_COMPONENT, HEADERS_COMPONENT, WALLET_COMPONENT, DHT_COMPONENT, DATABASE_COMPONENT, BLOB_COMPONENT, HEADERS_COMPONENT, WALLET_COMPONENT, DHT_COMPONENT,
HASH_ANNOUNCER_COMPONENT, STREAM_MANAGER_COMPONENT, PEER_PROTOCOL_SERVER_COMPONENT, HASH_ANNOUNCER_COMPONENT, STREAM_MANAGER_COMPONENT, PEER_PROTOCOL_SERVER_COMPONENT,
UPNP_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT UPNP_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT
) )
from lbrynet.extras.daemon.Daemon import Daemon from lbry.extras.daemon.Daemon import Daemon
class CLIIntegrationTest(AsyncioTestCase): class CLIIntegrationTest(AsyncioTestCase):

View file

@ -2,7 +2,7 @@ from math import ceil
from aiohttp import web from aiohttp import web
from lbrynet.testcase import CommandTestCase from lbry.testcase import CommandTestCase
class MockedCommentServer: class MockedCommentServer:

View file

@ -1,9 +1,9 @@
import asyncio import asyncio
from binascii import hexlify from binascii import hexlify
from lbrynet.dht import constants from lbry.dht import constants
from lbrynet.dht.node import Node from lbry.dht.node import Node
from lbrynet.dht.peer import PeerManager, KademliaPeer from lbry.dht.peer import PeerManager, KademliaPeer
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
@ -12,7 +12,7 @@ class DHTIntegrationTest(AsyncioTestCase):
async def asyncSetUp(self): async def asyncSetUp(self):
import logging import logging
logging.getLogger('asyncio').setLevel(logging.ERROR) logging.getLogger('asyncio').setLevel(logging.ERROR)
logging.getLogger('lbrynet.dht').setLevel(logging.WARN) logging.getLogger('lbry.dht').setLevel(logging.WARN)
self.nodes = [] self.nodes = []
self.known_node_addresses = [] self.known_node_addresses = []

View file

@ -3,8 +3,8 @@ import logging
import os import os
from binascii import hexlify from binascii import hexlify
from lbrynet.testcase import CommandTestCase from lbry.testcase import CommandTestCase
from lbrynet.blob_exchange.downloader import BlobDownloader from lbry.blob_exchange.downloader import BlobDownloader
class FileCommands(CommandTestCase): class FileCommands(CommandTestCase):

View file

@ -2,15 +2,15 @@ import asyncio
from torba.testcase import IntegrationTestCase from torba.testcase import IntegrationTestCase
import lbrynet.wallet import lbry.wallet
from lbrynet.schema.claim import Claim from lbry.schema.claim import Claim
from lbrynet.wallet.transaction import Transaction, Output, Input from lbry.wallet.transaction import Transaction, Output, Input
from lbrynet.wallet.dewies import dewies_to_lbc as d2l, lbc_to_dewies as l2d from lbry.wallet.dewies import dewies_to_lbc as d2l, lbc_to_dewies as l2d
class BasicTransactionTest(IntegrationTestCase): class BasicTransactionTest(IntegrationTestCase):
LEDGER = lbrynet.wallet LEDGER = lbry.wallet
async def test_creating_updating_and_abandoning_claim_with_channel(self): async def test_creating_updating_and_abandoning_claim_with_channel(self):

View file

@ -3,9 +3,9 @@ import json
import hashlib import hashlib
from unittest import skip from unittest import skip
from binascii import hexlify, unhexlify from binascii import hexlify, unhexlify
from lbrynet.testcase import CommandTestCase from lbry.testcase import CommandTestCase
from lbrynet.wallet.transaction import Transaction, Output from lbry.wallet.transaction import Transaction, Output
from lbrynet.schema.compat import OldClaimMessage from lbry.schema.compat import OldClaimMessage
from torba.client.hash import sha256, Base58 from torba.client.hash import sha256, Base58

View file

@ -4,9 +4,9 @@ import aiohttp
import aiohttp.web import aiohttp.web
import asyncio import asyncio
from lbrynet.utils import aiohttp_request from lbry.utils import aiohttp_request
from lbrynet.blob.blob_file import MAX_BLOB_SIZE from lbry.blob.blob_file import MAX_BLOB_SIZE
from lbrynet.testcase import CommandTestCase from lbry.testcase import CommandTestCase
def get_random_bytes(n: int) -> bytes: def get_random_bytes(n: int) -> bytes:

View file

@ -3,15 +3,15 @@ from unittest import mock
from torba.orchstr8.node import WalletNode, SPVNode from torba.orchstr8.node import WalletNode, SPVNode
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.wallet import LbryWalletManager, RegTestLedger from lbry.wallet import LbryWalletManager, RegTestLedger
from lbrynet.extras.daemon.Daemon import Daemon from lbry.extras.daemon.Daemon import Daemon
from lbrynet.extras.daemon.Components import WalletComponent from lbry.extras.daemon.Components import WalletComponent
from lbrynet.extras.daemon.Components import ( from lbry.extras.daemon.Components import (
DHT_COMPONENT, HASH_ANNOUNCER_COMPONENT, PEER_PROTOCOL_SERVER_COMPONENT, DHT_COMPONENT, HASH_ANNOUNCER_COMPONENT, PEER_PROTOCOL_SERVER_COMPONENT,
UPNP_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT UPNP_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT
) )
from lbrynet.extras.daemon.ComponentManager import ComponentManager from lbry.extras.daemon.ComponentManager import ComponentManager
class AccountSynchronization(AsyncioTestCase): class AccountSynchronization(AsyncioTestCase):

View file

@ -1,4 +1,4 @@
from lbrynet.testcase import CommandTestCase from lbry.testcase import CommandTestCase
class TransactionCommandsTestCase(CommandTestCase): class TransactionCommandsTestCase(CommandTestCase):

View file

@ -32,11 +32,11 @@ def reset_time(test_case, timestamp=DEFAULT_TIMESTAMP):
patcher.start().return_value = iso_time patcher.start().return_value = iso_time
test_case.addCleanup(patcher.stop) test_case.addCleanup(patcher.stop)
patcher = mock.patch('lbrynet.utils.now') patcher = mock.patch('lbry.utils.now')
patcher.start().return_value = timestamp patcher.start().return_value = timestamp
test_case.addCleanup(patcher.stop) test_case.addCleanup(patcher.stop)
patcher = mock.patch('lbrynet.utils.utcnow') patcher = mock.patch('lbry.utils.utcnow')
patcher.start().return_value = timestamp patcher.start().return_value = timestamp
test_case.addCleanup(patcher.stop) test_case.addCleanup(patcher.stop)

View file

@ -1,4 +1,4 @@
from lbrynet.extras.daemon import analytics from lbry.extras.daemon import analytics
import unittest import unittest

View file

@ -3,11 +3,11 @@ import tempfile
import shutil import shutil
import os import os
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from lbrynet.error import InvalidDataError, InvalidBlobHashError from lbry.error import InvalidDataError, InvalidBlobHashError
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.extras.daemon.storage import SQLiteStorage from lbry.extras.daemon.storage import SQLiteStorage
from lbrynet.blob.blob_manager import BlobManager from lbry.blob.blob_manager import BlobManager
from lbrynet.blob.blob_file import BlobFile, BlobBuffer, AbstractBlob from lbry.blob.blob_file import BlobFile, BlobBuffer, AbstractBlob
class TestBlob(AsyncioTestCase): class TestBlob(AsyncioTestCase):

View file

@ -3,9 +3,9 @@ import tempfile
import shutil import shutil
import os import os
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.extras.daemon.storage import SQLiteStorage from lbry.extras.daemon.storage import SQLiteStorage
from lbrynet.blob.blob_manager import BlobManager from lbry.blob.blob_manager import BlobManager
class TestBlobManager(AsyncioTestCase): class TestBlobManager(AsyncioTestCase):

View file

@ -5,17 +5,17 @@ from io import BytesIO
import shutil import shutil
import os import os
from lbrynet.blob_exchange.serialization import BlobRequest from lbry.blob_exchange.serialization import BlobRequest
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.extras.daemon.storage import SQLiteStorage from lbry.extras.daemon.storage import SQLiteStorage
from lbrynet.blob.blob_manager import BlobManager from lbry.blob.blob_manager import BlobManager
from lbrynet.blob_exchange.server import BlobServer, BlobServerProtocol from lbry.blob_exchange.server import BlobServer, BlobServerProtocol
from lbrynet.blob_exchange.client import request_blob from lbry.blob_exchange.client import request_blob
from lbrynet.dht.peer import KademliaPeer, PeerManager from lbry.dht.peer import KademliaPeer, PeerManager
# import logging # import logging
# logging.getLogger("lbrynet").setLevel(logging.DEBUG) # logging.getLogger("lbry").setLevel(logging.DEBUG)
def mock_config(): def mock_config():

View file

@ -1,7 +1,7 @@
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from lbrynet.extras.daemon.comment_client import sign_comment from lbry.extras.daemon.comment_client import sign_comment
from lbrynet.extras.daemon.comment_client import is_comment_signed_by_channel from lbry.extras.daemon.comment_client import is_comment_signed_by_channel
from tests.unit.wallet.test_schema_signing import get_stream, get_channel from tests.unit.wallet.test_schema_signing import get_stream, get_channel

View file

@ -1,13 +1,13 @@
import asyncio import asyncio
from torba.testcase import AsyncioTestCase, AdvanceTimeTestCase from torba.testcase import AsyncioTestCase, AdvanceTimeTestCase
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.extras.daemon.ComponentManager import ComponentManager from lbry.extras.daemon.ComponentManager import ComponentManager
from lbrynet.extras.daemon.Components import DATABASE_COMPONENT, DHT_COMPONENT from lbry.extras.daemon.Components import DATABASE_COMPONENT, DHT_COMPONENT
from lbrynet.extras.daemon.Components import HASH_ANNOUNCER_COMPONENT, UPNP_COMPONENT from lbry.extras.daemon.Components import HASH_ANNOUNCER_COMPONENT, UPNP_COMPONENT
from lbrynet.extras.daemon.Components import PEER_PROTOCOL_SERVER_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT from lbry.extras.daemon.Components import PEER_PROTOCOL_SERVER_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT
from lbrynet.extras.daemon.Components import HEADERS_COMPONENT from lbry.extras.daemon.Components import HEADERS_COMPONENT
from lbrynet.extras.daemon import Components from lbry.extras.daemon import Components
class TestComponentManager(AsyncioTestCase): class TestComponentManager(AsyncioTestCase):

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import unittest import unittest
import asyncio import asyncio
from lbrynet import utils from lbry import utils
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase

View file

@ -4,11 +4,11 @@ import unittest
import asyncio import asyncio
import logging import logging
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.extras.daemon.storage import SQLiteStorage from lbry.extras.daemon.storage import SQLiteStorage
from lbrynet.blob.blob_info import BlobInfo from lbry.blob.blob_info import BlobInfo
from lbrynet.blob.blob_manager import BlobManager from lbry.blob.blob_manager import BlobManager
from lbrynet.stream.descriptor import StreamDescriptor from lbry.stream.descriptor import StreamDescriptor
from tests.test_utils import random_lbry_hash from tests.test_utils import random_lbry_hash
log = logging.getLogger() log = logging.getLogger()

View file

@ -1,7 +1,7 @@
import asyncio import asyncio
from unittest import mock, TestCase from unittest import mock, TestCase
from lbrynet.dht.protocol.data_store import DictDataStore from lbry.dht.protocol.data_store import DictDataStore
from lbrynet.dht.peer import PeerManager from lbry.dht.peer import PeerManager
class DataStoreTests(TestCase): class DataStoreTests(TestCase):

View file

@ -1,5 +1,5 @@
import unittest import unittest
from lbrynet.dht.protocol.distance import Distance from lbry.dht.protocol.distance import Distance
class DistanceTests(unittest.TestCase): class DistanceTests(unittest.TestCase):

View file

@ -1,9 +1,9 @@
import struct import struct
import asyncio import asyncio
from lbrynet.utils import generate_id from lbry.utils import generate_id
from lbrynet.dht.protocol.routing_table import KBucket from lbry.dht.protocol.routing_table import KBucket
from lbrynet.dht.peer import PeerManager, KademliaPeer from lbry.dht.peer import PeerManager, KademliaPeer
from lbrynet.dht import constants from lbry.dht import constants
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase

View file

@ -2,10 +2,10 @@ import asyncio
import binascii import binascii
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from tests import dht_mocks from tests import dht_mocks
from lbrynet.dht.serialization.bencoding import bencode, bdecode from lbry.dht.serialization.bencoding import bencode, bdecode
from lbrynet.dht import constants from lbry.dht import constants
from lbrynet.dht.protocol.protocol import KademliaProtocol from lbry.dht.protocol.protocol import KademliaProtocol
from lbrynet.dht.peer import PeerManager from lbry.dht.peer import PeerManager
class TestProtocol(AsyncioTestCase): class TestProtocol(AsyncioTestCase):

View file

@ -1,9 +1,9 @@
import asyncio import asyncio
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from tests import dht_mocks from tests import dht_mocks
from lbrynet.dht import constants from lbry.dht import constants
from lbrynet.dht.node import Node from lbry.dht.node import Node
from lbrynet.dht.peer import PeerManager from lbry.dht.peer import PeerManager
expected_ranges = [ expected_ranges = [
@ -107,15 +107,15 @@ class TestRouting(AsyncioTestCase):
# #
# from twisted.trial import unittest # from twisted.trial import unittest
# from twisted.internet import defer # from twisted.internet import defer
# from lbrynet.dht import constants # from lbry.dht import constants
# from lbrynet.dht.routingtable import TreeRoutingTable # from lbry.dht.routingtable import TreeRoutingTable
# from lbrynet.dht.contact import ContactManager # from lbry.dht.contact import ContactManager
# from lbrynet.dht.distance import Distance # from lbry.dht.distance import Distance
# from lbrynet.utils import generate_id # from lbry.utils import generate_id
# #
# #
# class FakeRPCProtocol: # class FakeRPCProtocol:
# """ Fake RPC protocol; allows lbrynet.dht.contact.Contact objects to "send" RPCs """ # """ Fake RPC protocol; allows lbry.dht.contact.Contact objects to "send" RPCs """
# def sendRPC(self, *args, **kwargs): # def sendRPC(self, *args, **kwargs):
# return defer.succeed(None) # return defer.succeed(None)
# #
@ -270,18 +270,18 @@ class TestRouting(AsyncioTestCase):
# # is not in bucket 0. so we put own_id at the end so we can keep splitting by adding to the # # is not in bucket 0. so we put own_id at the end so we can keep splitting by adding to the
# # end # # end
# #
# self.table = lbrynet.dht.routingtable.OptimizedTreeRoutingTable(own_id) # self.table = lbry.dht.routingtable.OptimizedTreeRoutingTable(own_id)
# #
# def fill_bucket(self, bucket_min): # def fill_bucket(self, bucket_min):
# bucket_size = lbrynet.dht.constants.k # bucket_size = lbry.dht.constants.k
# for i in range(bucket_min, bucket_min + bucket_size): # for i in range(bucket_min, bucket_min + bucket_size):
# self.table.addContact(lbrynet.dht.contact.Contact(long(i), '127.0.0.1', 9999, None)) # self.table.addContact(lbry.dht.contact.Contact(long(i), '127.0.0.1', 9999, None))
# #
# def overflow_bucket(self, bucket_min): # def overflow_bucket(self, bucket_min):
# bucket_size = lbrynet.dht.constants.k # bucket_size = lbry.dht.constants.k
# self.fill_bucket(bucket_min) # self.fill_bucket(bucket_min)
# self.table.addContact( # self.table.addContact(
# lbrynet.dht.contact.Contact(long(bucket_min + bucket_size + 1), # lbry.dht.contact.Contact(long(bucket_min + bucket_size + 1),
# '127.0.0.1', 9999, None)) # '127.0.0.1', 9999, None))
# #
# def testKeyError(self): # def testKeyError(self):
@ -290,19 +290,19 @@ class TestRouting(AsyncioTestCase):
# bucket_middle = self.table._buckets[0].rangeMax / 2 # bucket_middle = self.table._buckets[0].rangeMax / 2
# #
# # fill last bucket # # fill last bucket
# self.fill_bucket(self.table._buckets[0].rangeMax - lbrynet.dht.constants.k - 1) # self.fill_bucket(self.table._buckets[0].rangeMax - lbry.dht.constants.k - 1)
# # -1 in previous line because own_id is in last bucket # # -1 in previous line because own_id is in last bucket
# #
# # fill/overflow 7 more buckets # # fill/overflow 7 more buckets
# bucket_start = 0 # bucket_start = 0
# for i in range(0, lbrynet.dht.constants.k): # for i in range(0, lbry.dht.constants.k):
# self.overflow_bucket(bucket_start) # self.overflow_bucket(bucket_start)
# bucket_start += bucket_middle / (2 ** i) # bucket_start += bucket_middle / (2 ** i)
# #
# # replacement cache now has k-1 entries. # # replacement cache now has k-1 entries.
# # adding one more contact to bucket 0 used to cause a KeyError, but it should work # # adding one more contact to bucket 0 used to cause a KeyError, but it should work
# self.table.addContact( # self.table.addContact(
# lbrynet.dht.contact.Contact(long(lbrynet.dht.constants.k + 2), '127.0.0.1', 9999, None)) # lbry.dht.contact.Contact(long(lbry.dht.constants.k + 2), '127.0.0.1', 9999, None))
# #
# # import math # # import math
# # print "" # # print ""

View file

@ -1,5 +1,5 @@
import unittest import unittest
from lbrynet.dht.serialization.bencoding import _bencode, bencode, bdecode, DecodeError from lbry.dht.serialization.bencoding import _bencode, bencode, bdecode, DecodeError
class EncodeDecodeTest(unittest.TestCase): class EncodeDecodeTest(unittest.TestCase):

View file

@ -1,9 +1,9 @@
import unittest import unittest
from lbrynet.dht.error import DecodeError from lbry.dht.error import DecodeError
from lbrynet.dht.serialization.bencoding import _bencode from lbry.dht.serialization.bencoding import _bencode
from lbrynet.dht.serialization.datagram import RequestDatagram, ResponseDatagram, decode_datagram, ErrorDatagram from lbry.dht.serialization.datagram import RequestDatagram, ResponseDatagram, decode_datagram, ErrorDatagram
from lbrynet.dht.serialization.datagram import REQUEST_TYPE, RESPONSE_TYPE, ERROR_TYPE from lbry.dht.serialization.datagram import REQUEST_TYPE, RESPONSE_TYPE, ERROR_TYPE
from lbrynet.dht.serialization.datagram import make_compact_address, decode_compact_address from lbry.dht.serialization.datagram import make_compact_address, decode_compact_address
class TestDatagram(unittest.TestCase): class TestDatagram(unittest.TestCase):

View file

@ -5,12 +5,12 @@ import socket
import asyncio import asyncio
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from tests import dht_mocks from tests import dht_mocks
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.dht import constants from lbry.dht import constants
from lbrynet.dht.node import Node from lbry.dht.node import Node
from lbrynet.dht.peer import PeerManager from lbry.dht.peer import PeerManager
from lbrynet.dht.blob_announcer import BlobAnnouncer from lbry.dht.blob_announcer import BlobAnnouncer
from lbrynet.extras.daemon.storage import SQLiteStorage from lbry.extras.daemon.storage import SQLiteStorage
class TestBlobAnnouncer(AsyncioTestCase): class TestBlobAnnouncer(AsyncioTestCase):

View file

@ -2,9 +2,9 @@ import asyncio
import typing import typing
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from tests import dht_mocks from tests import dht_mocks
from lbrynet.dht import constants from lbry.dht import constants
from lbrynet.dht.node import Node from lbry.dht.node import Node
from lbrynet.dht.peer import PeerManager from lbry.dht.peer import PeerManager
class TestNodePingQueueDiscover(AsyncioTestCase): class TestNodePingQueueDiscover(AsyncioTestCase):

View file

@ -1,7 +1,7 @@
import asyncio import asyncio
import unittest import unittest
from lbrynet.utils import generate_id from lbry.utils import generate_id
from lbrynet.dht.peer import PeerManager from lbry.dht.peer import PeerManager
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase

View file

@ -2,16 +2,16 @@ import unittest
from unittest import mock from unittest import mock
import json import json
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.extras.daemon.storage import SQLiteStorage from lbry.extras.daemon.storage import SQLiteStorage
from lbrynet.extras.daemon.ComponentManager import ComponentManager from lbry.extras.daemon.ComponentManager import ComponentManager
from lbrynet.extras.daemon.Components import DATABASE_COMPONENT, DHT_COMPONENT, WALLET_COMPONENT from lbry.extras.daemon.Components import DATABASE_COMPONENT, DHT_COMPONENT, WALLET_COMPONENT
from lbrynet.extras.daemon.Components import HASH_ANNOUNCER_COMPONENT from lbry.extras.daemon.Components import HASH_ANNOUNCER_COMPONENT
from lbrynet.extras.daemon.Components import UPNP_COMPONENT, BLOB_COMPONENT from lbry.extras.daemon.Components import UPNP_COMPONENT, BLOB_COMPONENT
from lbrynet.extras.daemon.Components import PEER_PROTOCOL_SERVER_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT from lbry.extras.daemon.Components import PEER_PROTOCOL_SERVER_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT
from lbrynet.extras.daemon.Components import HEADERS_COMPONENT from lbry.extras.daemon.Components import HEADERS_COMPONENT
from lbrynet.extras.daemon.Daemon import Daemon as LBRYDaemon from lbry.extras.daemon.Daemon import Daemon as LBRYDaemon
from lbrynet.wallet import LbryWalletManager from lbry.wallet import LbryWalletManager
from torba.client.wallet import Wallet from torba.client.wallet import Wallet
from tests import test_utils from tests import test_utils

View file

@ -1,8 +1,8 @@
import unittest import unittest
from decimal import Decimal from decimal import Decimal
from lbrynet.schema.claim import Claim from lbry.schema.claim import Claim
from lbrynet.extras.daemon import exchange_rate_manager from lbry.extras.daemon import exchange_rate_manager
from lbrynet.error import InvalidExchangeRateResponse from lbry.error import InvalidExchangeRateResponse
from tests import test_utils from tests import test_utils

View file

@ -1,6 +1,6 @@
import unittest import unittest
from lbrynet.extras.daemon.Daemon import sort_claim_results from lbry.extras.daemon.Daemon import sort_claim_results
class ClaimsComparatorTest(unittest.TestCase): class ClaimsComparatorTest(unittest.TestCase):

View file

@ -1,5 +1,5 @@
import unittest import unittest
from lbrynet.schema import mime_types from lbry.schema import mime_types
class TestMimeTypes(unittest.TestCase): class TestMimeTypes(unittest.TestCase):

View file

@ -1,7 +1,7 @@
from unittest import TestCase from unittest import TestCase
from binascii import unhexlify from binascii import unhexlify
from lbrynet.schema import Claim from lbry.schema import Claim
class TestOldJSONSchemaCompatibility(TestCase): class TestOldJSONSchemaCompatibility(TestCase):

View file

@ -1,7 +1,7 @@
from unittest import TestCase from unittest import TestCase
from decimal import Decimal from decimal import Decimal
from lbrynet.schema.claim import Claim, Stream from lbry.schema.claim import Claim, Stream
class TestClaimContainerAwareness(TestCase): class TestClaimContainerAwareness(TestCase):

View file

@ -1,6 +1,6 @@
import unittest import unittest
from lbrynet.schema.url import URL from lbry.schema.url import URL
claim_id = "63f2da17b0d90042c559cc73b6b17f853945c43e" claim_id = "63f2da17b0d90042c559cc73b6b17f853945c43e"

View file

@ -3,14 +3,14 @@ import shutil
import unittest import unittest
from unittest import mock from unittest import mock
import asyncio import asyncio
from lbrynet.blob.blob_file import MAX_BLOB_SIZE from lbry.blob.blob_file import MAX_BLOB_SIZE
from lbrynet.blob_exchange.serialization import BlobResponse from lbry.blob_exchange.serialization import BlobResponse
from lbrynet.blob_exchange.server import BlobServerProtocol from lbry.blob_exchange.server import BlobServerProtocol
from lbrynet.dht.node import Node from lbry.dht.node import Node
from lbrynet.dht.peer import KademliaPeer from lbry.dht.peer import KademliaPeer
from lbrynet.extras.daemon.storage import StoredStreamClaim from lbry.extras.daemon.storage import StoredStreamClaim
from lbrynet.stream.managed_stream import ManagedStream from lbry.stream.managed_stream import ManagedStream
from lbrynet.stream.descriptor import StreamDescriptor from lbry.stream.descriptor import StreamDescriptor
from tests.unit.blob_exchange.test_transfer_blob import BlobExchangeTestBase from tests.unit.blob_exchange.test_transfer_blob import BlobExchangeTestBase

View file

@ -3,11 +3,11 @@ import asyncio
import tempfile import tempfile
import shutil import shutil
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.extras.daemon.storage import SQLiteStorage from lbry.extras.daemon.storage import SQLiteStorage
from lbrynet.blob.blob_manager import BlobManager from lbry.blob.blob_manager import BlobManager
from lbrynet.stream.stream_manager import StreamManager from lbry.stream.stream_manager import StreamManager
from lbrynet.stream.reflector.server import ReflectorServer from lbry.stream.reflector.server import ReflectorServer
class TestStreamAssembler(AsyncioTestCase): class TestStreamAssembler(AsyncioTestCase):

View file

@ -4,13 +4,13 @@ import tempfile
import shutil import shutil
import json import json
from lbrynet.blob.blob_file import BlobFile from lbry.blob.blob_file import BlobFile
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from lbrynet.conf import Config from lbry.conf import Config
from lbrynet.error import InvalidStreamDescriptorError from lbry.error import InvalidStreamDescriptorError
from lbrynet.extras.daemon.storage import SQLiteStorage from lbry.extras.daemon.storage import SQLiteStorage
from lbrynet.blob.blob_manager import BlobManager from lbry.blob.blob_manager import BlobManager
from lbrynet.stream.descriptor import StreamDescriptor from lbry.stream.descriptor import StreamDescriptor
class TestStreamDescriptor(AsyncioTestCase): class TestStreamDescriptor(AsyncioTestCase):

View file

@ -7,17 +7,17 @@ import json
from decimal import Decimal from decimal import Decimal
from tests.unit.blob_exchange.test_transfer_blob import BlobExchangeTestBase from tests.unit.blob_exchange.test_transfer_blob import BlobExchangeTestBase
from tests.unit.lbrynet_daemon.test_ExchangeRateManager import get_dummy_exchange_rate_manager from tests.unit.lbrynet_daemon.test_ExchangeRateManager import get_dummy_exchange_rate_manager
from lbrynet.utils import generate_id from lbry.utils import generate_id
from lbrynet.error import InsufficientFundsError, KeyFeeAboveMaxAllowed, ResolveError, DownloadSDTimeout, \ from lbry.error import InsufficientFundsError, KeyFeeAboveMaxAllowed, ResolveError, DownloadSDTimeout, \
DownloadDataTimeout DownloadDataTimeout
from lbrynet.wallet.manager import LbryWalletManager from lbry.wallet.manager import LbryWalletManager
from lbrynet.extras.daemon.analytics import AnalyticsManager from lbry.extras.daemon.analytics import AnalyticsManager
from lbrynet.stream.stream_manager import StreamManager from lbry.stream.stream_manager import StreamManager
from lbrynet.stream.descriptor import StreamDescriptor from lbry.stream.descriptor import StreamDescriptor
from lbrynet.dht.node import Node from lbry.dht.node import Node
from lbrynet.dht.protocol.protocol import KademliaProtocol from lbry.dht.protocol.protocol import KademliaProtocol
from lbrynet.dht.protocol.routing_table import TreeRoutingTable from lbry.dht.protocol.routing_table import TreeRoutingTable
from lbrynet.schema.claim import Claim from lbry.schema.claim import Claim
def get_mock_node(peer=None): def get_mock_node(peer=None):

View file

@ -5,9 +5,9 @@ from unittest import TestCase
import docopt import docopt
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from lbrynet.extras.cli import normalize_value, main from lbry.extras.cli import normalize_value, main
from lbrynet.extras.system_info import get_platform from lbry.extras.system_info import get_platform
from lbrynet.extras.daemon.Daemon import Daemon from lbry.extras.daemon.Daemon import Daemon
class CLITest(AsyncioTestCase): class CLITest(AsyncioTestCase):

View file

@ -4,8 +4,8 @@ import types
import tempfile import tempfile
import unittest import unittest
import argparse import argparse
from lbrynet.conf import Config, BaseConfig, String, Integer, Toggle, Servers, Strings, NOT_SET from lbry.conf import Config, BaseConfig, String, Integer, Toggle, Servers, Strings, NOT_SET
from lbrynet.error import InvalidCurrencyError from lbry.error import InvalidCurrencyError
class TestConfig(BaseConfig): class TestConfig(BaseConfig):

View file

@ -4,13 +4,13 @@ import hashlib
from binascii import hexlify from binascii import hexlify
from torba.client.constants import COIN, NULL_HASH32 from torba.client.constants import COIN, NULL_HASH32
from lbrynet.schema.claim import Claim from lbry.schema.claim import Claim
from lbrynet.wallet.server.db import SQLDB from lbry.wallet.server.db import SQLDB
from lbrynet.wallet.server.coin import LBCRegTest from lbry.wallet.server.coin import LBCRegTest
from lbrynet.wallet.server.trending import TRENDING_WINDOW from lbry.wallet.server.trending import TRENDING_WINDOW
from lbrynet.wallet.server.canonical import FindShortestID from lbry.wallet.server.canonical import FindShortestID
from lbrynet.wallet.server.block_processor import Timer from lbry.wallet.server.block_processor import Timer
from lbrynet.wallet.transaction import Transaction, Input, Output from lbry.wallet.transaction import Transaction, Input, Output
def get_output(amount=COIN, pubkey_hash=NULL_HASH32): def get_output(amount=COIN, pubkey_hash=NULL_HASH32):

View file

@ -1,9 +1,9 @@
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from torba.client.wallet import Wallet from torba.client.wallet import Wallet
from lbrynet.wallet.ledger import MainNetLedger, WalletDatabase from lbry.wallet.ledger import MainNetLedger, WalletDatabase
from lbrynet.wallet.header import Headers from lbry.wallet.header import Headers
from lbrynet.wallet.account import Account from lbry.wallet.account import Account
class TestAccount(AsyncioTestCase): class TestAccount(AsyncioTestCase):

View file

@ -1,7 +1,7 @@
import unittest import unittest
from binascii import hexlify, unhexlify from binascii import hexlify, unhexlify
from lbrynet.wallet.claim_proofs import get_hash_for_outpoint, verify_proof from lbry.wallet.claim_proofs import get_hash_for_outpoint, verify_proof
from torba.client.hash import double_sha256 from torba.client.hash import double_sha256

View file

@ -1,6 +1,6 @@
import unittest import unittest
from lbrynet.wallet.dewies import lbc_to_dewies as l2d, dewies_to_lbc as d2l from lbry.wallet.dewies import lbc_to_dewies as l2d, dewies_to_lbc as d2l
class TestDeweyConversion(unittest.TestCase): class TestDeweyConversion(unittest.TestCase):

View file

@ -3,7 +3,7 @@ from binascii import unhexlify
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from torba.client.util import ArithUint256 from torba.client.util import ArithUint256
from lbrynet.wallet.ledger import Headers from lbry.wallet.ledger import Headers
class TestHeaders(AsyncioTestCase): class TestHeaders(AsyncioTestCase):

View file

@ -1,9 +1,9 @@
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from torba.client.wallet import Wallet from torba.client.wallet import Wallet
from lbrynet.wallet.account import Account from lbry.wallet.account import Account
from lbrynet.wallet.transaction import Transaction, Output, Input from lbry.wallet.transaction import Transaction, Output, Input
from lbrynet.wallet.ledger import MainNetLedger from lbry.wallet.ledger import MainNetLedger
class LedgerTestCase(AsyncioTestCase): class LedgerTestCase(AsyncioTestCase):

View file

@ -5,10 +5,10 @@ from cryptography.exceptions import InvalidSignature
from torba.testcase import AsyncioTestCase from torba.testcase import AsyncioTestCase
from torba.client.constants import CENT, NULL_HASH32 from torba.client.constants import CENT, NULL_HASH32
from lbrynet.wallet.ledger import MainNetLedger from lbry.wallet.ledger import MainNetLedger
from lbrynet.wallet.transaction import Transaction, Input, Output from lbry.wallet.transaction import Transaction, Input, Output
from lbrynet.schema.claim import Claim from lbry.schema.claim import Claim
def get_output(amount=CENT, pubkey_hash=NULL_HASH32): def get_output(amount=CENT, pubkey_hash=NULL_HASH32):

View file

@ -1,7 +1,7 @@
import unittest import unittest
from binascii import hexlify, unhexlify from binascii import hexlify, unhexlify
from lbrynet.wallet.script import OutputScript from lbry.wallet.script import OutputScript
class TestPayClaimNamePubkeyHash(unittest.TestCase): class TestPayClaimNamePubkeyHash(unittest.TestCase):

View file

@ -5,8 +5,8 @@ from torba.testcase import AsyncioTestCase
from torba.client.constants import CENT, COIN, NULL_HASH32 from torba.client.constants import CENT, COIN, NULL_HASH32
from torba.client.wallet import Wallet from torba.client.wallet import Wallet
from lbrynet.wallet.ledger import MainNetLedger from lbry.wallet.ledger import MainNetLedger
from lbrynet.wallet.transaction import Transaction, Output, Input from lbry.wallet.transaction import Transaction, Output, Input
FEE_PER_BYTE = 50 FEE_PER_BYTE = 50