Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure 2nd pass through transaction create loop will generate change > DUST. #3719

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

moodyjon
Copy link
Contributor

Fixes #3713

Reproduction of something similar to the original problem:

(lbry-venv) swdev1@Jonathans-Mac-mini lbry-sdk % python -m unittest -vv -k test_liquidate_at_loss tests/unit/wallet/test_transaction.py 
test_liquidate_at_loss (tests.unit.wallet.test_transaction.TransactionIOBalancing) ... FAIL
test_liquidate_at_loss_tiny_utxos (tests.unit.wallet.test_transaction.TransactionIOBalancing) ... 2022-12-12 11:19:56,267 - root - ERROR - Failed to create transaction:
Traceback (most recent call last):
  File "/Users/swdev1/lbry-sdk/lbry/wallet/transaction.py", line 822, in create
    raise InsufficientFundsError()
lbry.error.InsufficientFundsError: Not enough funds to cover this transaction.
ok

======================================================================
FAIL: test_liquidate_at_loss (tests.unit.wallet.test_transaction.TransactionIOBalancing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/swdev1/lbry-sdk/lbry/testcase.py", line 145, in run
    self.loop.run_until_complete(maybe_coroutine)
  File "/usr/local/Cellar/[email protected]/3.7.13/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "/Users/swdev1/lbry-sdk/tests/unit/wallet/test_transaction.py", line 549, in test_liquidate_at_loss
    self.assertListEqual([1100], [o.amount for o in tx.outputs])
AssertionError: Lists differ: [1100] != []

First list contains 1 additional elements.
First extra element 0:
1100

- [1100]
+ []

----------------------------------------------------------------------
Ran 2 tests in 1.295s

FAILED (failures=1)

@coveralls
Copy link

coveralls commented Dec 12, 2022

Coverage Status

Coverage decreased (-0.02%) to 56.623% when pulling bea2089 on moodyjon:zero_tx_outputs2 into 6258651 on lbryio:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

invalid transaction: 0 output tx created, fails to broadcast
3 participants