* Funding channel with "all"
* Added test for fund all
This commit is contained in:
Mark Beckwith
2018-03-20 18:06:04 -05:00
committed by Christian Decker
parent 5737853123
commit 489d8d04a6
3 changed files with 63 additions and 23 deletions

View File

@@ -3121,6 +3121,21 @@ class LightningDTests(BaseLightningDTests):
assert outputs[0] > 8990000
assert outputs[2] == 10000000
def test_funding_all(self):
"""Add some funds, fund a channel using all funds, make sure no funds remain
"""
l1, l2 = self.connect()
self.give_funds(l1, 0.1 * 10**8)
outputs = l1.db_query('SELECT value FROM outputs WHERE status=0;')
assert len(outputs) == 1 and outputs[0]['value'] == 10000000
l1.rpc.fundchannel(l2.info['id'], "all")
outputs = l1.db_query('SELECT value FROM outputs WHERE status=0;')
assert len(outputs) == 0
def test_funding_fail(self):
"""Add some funds, fund a channel without enough funds"""
# Previous runs with same bitcoind can leave funds!