diff --git a/lbrynet/extras/wallet/account.py b/lbrynet/extras/wallet/account.py index df73c4a46..045298e08 100644 --- a/lbrynet/extras/wallet/account.py +++ b/lbrynet/extras/wallet/account.py @@ -95,7 +95,9 @@ class Account(BaseAccount): txid, nout = maybe_claim_id.split(':') tx = await self.ledger.db.get_transaction(txid=txid) if not tx: - log.warning("Claim migration failed to find a transaction for outpoint %s:%i") + log.warning( + "Claim migration failed to find a transaction for outpoint %s", maybe_claim_id + ) results['previous-corrupted'] += 1 continue if tx.outputs[int(nout)].script.is_claim_involved: diff --git a/tests/integration/wallet/test_commands.py b/tests/integration/wallet/test_commands.py index aadc08c91..7b8557bf6 100644 --- a/tests/integration/wallet/test_commands.py +++ b/tests/integration/wallet/test_commands.py @@ -8,6 +8,7 @@ from types import SimpleNamespace from twisted.trial import unittest from twisted.internet import utils, defer from twisted.internet.utils import runWithWarningsSuppressed as originalRunWith +from lbrynet.p2p.Error import InsufficientFundsError from torba.testcase import IntegrationTestCase as BaseIntegrationTestCase @@ -591,6 +592,19 @@ class PublishCommand(CommandTestCase): self.assertEqual('0.009348', await self.daemon.jsonrpc_account_balance()) + # fails when specifying more than available + with tempfile.NamedTemporaryFile() as file: + file.write(b'hi!') + file.flush() + with self.assertRaisesRegex( + InsufficientFundsError, + "Please lower the bid value, the maximum amount" + " you can specify for this claim is 9.979274." + ): + await self.out(self.daemon.jsonrpc_publish( + 'hovercraft', '9.98', file_path=file.name + )) + class SupportingSupports(CommandTestCase):