diff --git a/lbry/wallet/__init__.py b/lbry/wallet/__init__.py index 5f2fffa21..aa1b558b0 100644 --- a/lbry/wallet/__init__.py +++ b/lbry/wallet/__init__.py @@ -6,12 +6,12 @@ __node_url__ = ( ) __spvserver__ = 'lbry.wallet.server.coin.LBCRegTest' -from .wallet import Wallet, WalletStorage, TimestampedPreferences, ENCRYPT_ON_DISK -from .manager import WalletManager -from .network import Network -from .ledger import Ledger, RegTestLedger, TestNetLedger, BlockHeightEvent -from .account import Account, AddressManager, SingleKey, HierarchicalDeterministic, DeterministicChannelKeyManager -from .transaction import Transaction, Output, Input -from .script import OutputScript, InputScript -from .database import SQLiteMixin, Database -from .header import Headers +from lbry.wallet.wallet import Wallet, WalletStorage, TimestampedPreferences, ENCRYPT_ON_DISK +from lbry.wallet.manager import WalletManager +from lbry.wallet.network import Network +from lbry.wallet.ledger import Ledger, RegTestLedger, TestNetLedger, BlockHeightEvent +from lbry.wallet.account import Account, AddressManager, SingleKey, HierarchicalDeterministic +from lbry.wallet.transaction import Transaction, Output, Input +from lbry.wallet.script import OutputScript, InputScript +from lbry.wallet.database import SQLiteMixin, Database +from lbry.wallet.header import Headers diff --git a/lbry/wallet/ledger.py b/lbry/wallet/ledger.py index 652c764d4..b378fef64 100644 --- a/lbry/wallet/ledger.py +++ b/lbry/wallet/ledger.py @@ -16,18 +16,18 @@ from lbry.crypto.hash import hash160, double_sha256, sha256 from lbry.crypto.base58 import Base58 from lbry.utils import LRUCacheWithMetrics -from .tasks import TaskGroup -from .database import Database -from .stream import StreamController -from .dewies import dewies_to_lbc -from .account import Account, AddressManager, SingleKey -from .network import Network -from .transaction import Transaction, Output -from .header import Headers, UnvalidatedHeaders -from .checkpoints import HASHES -from .constants import TXO_TYPES, CLAIM_TYPES, COIN, NULL_HASH32 +from lbry.wallet.tasks import TaskGroup +from lbry.wallet.database import Database +from lbry.wallet.stream import StreamController +from lbry.wallet.dewies import dewies_to_lbc +from lbry.wallet.account import Account, AddressManager, SingleKey +from lbry.wallet.network import Network +from lbry.wallet.transaction import Transaction, Output +from lbry.wallet.header import Headers, UnvalidatedHeaders +from lbry.wallet.checkpoints import HASHES +from lbry.wallet.constants import TXO_TYPES, CLAIM_TYPES, COIN, NULL_HASH32 from .bip32 import PublicKey, PrivateKey -from .coinselection import CoinSelector +from lbry.wallet.coinselection import CoinSelector log = logging.getLogger(__name__) @@ -739,7 +739,7 @@ class Ledger(metaclass=LedgerRegistry): while timeout and (int(time.perf_counter()) - start) <= timeout: if await self._wait_round(tx, height, addresses): return - raise asyncio.TimeoutError('Timed out waiting for transaction.') + raise asyncio.TimeoutError(f'Timed out waiting for transaction. {tx.id}') async def _wait_round(self, tx: Transaction, height: int, addresses: Iterable[str]): records = await self.db.get_addresses(address__in=addresses) diff --git a/lbry/wallet/manager.py b/lbry/wallet/manager.py index d5b73aa21..adf6b3962 100644 --- a/lbry/wallet/manager.py +++ b/lbry/wallet/manager.py @@ -12,13 +12,13 @@ from typing import List, Type, MutableSequence, MutableMapping, Optional from lbry.error import KeyFeeAboveMaxAllowedError, WalletNotLoadedError from lbry.conf import Config, NOT_SET -from .dewies import dewies_to_lbc -from .account import Account -from .ledger import Ledger, LedgerRegistry -from .transaction import Transaction, Output -from .database import Database -from .wallet import Wallet, WalletStorage, ENCRYPT_ON_DISK -from .rpc.jsonrpc import CodeMessageError +from lbry.wallet.dewies import dewies_to_lbc +from lbry.wallet.account import Account +from lbry.wallet.ledger import Ledger, LedgerRegistry +from lbry.wallet.transaction import Transaction, Output +from lbry.wallet.database import Database +from lbry.wallet.wallet import Wallet, WalletStorage, ENCRYPT_ON_DISK +from lbry.wallet.rpc.jsonrpc import CodeMessageError if typing.TYPE_CHECKING: from lbry.extras.daemon.exchange_rate_manager import ExchangeRateManager diff --git a/lbry/wallet/server/tx.py b/lbry/wallet/server/tx.py index 33cf3da3a..fefe2fd6f 100644 --- a/lbry/wallet/server/tx.py +++ b/lbry/wallet/server/tx.py @@ -98,7 +98,7 @@ class Deserializer: TX_HASH_FN = staticmethod(double_sha256) def __init__(self, binary, start=0): - assert isinstance(binary, bytes) + assert isinstance(binary, bytes), f"type {type(binary)} is not 'bytes'" self.binary = binary self.binary_length = len(binary) self.cursor = start