ttest_coinchooser.py - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
ttest_coinchooser.py (911B)
---
1 from electrum.coinchooser import CoinChooserPrivacy
2 from electrum.util import NotEnoughFunds
3
4 from . import ElectrumTestCase
5
6
7 class TestCoinChooser(ElectrumTestCase):
8
9 def test_bucket_candidates_with_empty_buckets(self):
10 def sufficient_funds(buckets, *, bucket_value_sum):
11 return True
12 coin_chooser = CoinChooserPrivacy(enable_output_value_rounding=False)
13 self.assertEqual([[]], coin_chooser.bucket_candidates_any([], sufficient_funds))
14 self.assertEqual([[]], coin_chooser.bucket_candidates_prefer_confirmed([], sufficient_funds))
15 def sufficient_funds(buckets, *, bucket_value_sum):
16 return False
17 with self.assertRaises(NotEnoughFunds):
18 coin_chooser.bucket_candidates_any([], sufficient_funds)
19 with self.assertRaises(NotEnoughFunds):
20 coin_chooser.bucket_candidates_prefer_confirmed([], sufficient_funds)