Skip to content

Commit

Permalink
pytest: Add test for mixed zeroreserve funding
Browse files Browse the repository at this point in the history
Tests that we can have zeroreserve nodes accept and open new channels
with non-zeroreserve nodes, without throwing errors
  • Loading branch information
cdecker committed Jun 24, 2022
1 parent 308e57c commit 1cb92f7
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/test_opening.py
Original file line number Diff line number Diff line change
Expand Up @@ -1469,3 +1469,32 @@ def test_zeroreserve(node_factory, bitcoind):
c = l2.rpc.close(l1.info['id'])
decoded = bitcoind.rpc.decoderawtransaction(c['tx'])
assert len(decoded['vout']) == 1


def test_zeroreserve_mixed(node_factory, bitcoind):
"""l1 runs with zeroreserve, l2 and l3 without, should still work
Basically tests that l1 doesn't get upset when l2 allows us to
drop below dust.
"""
plugin_path = Path(__file__).parent / "plugins" / "zeroreserve.py"
opts = [
{
'plugin': str(plugin_path),
'reserve': '0sat',
'dev-allowdustreserve': True,
},{
'dev-allowdustreserve': False,
},{
'dev-allowdustreserve': False,
}
]
l1, l2, l3 = node_factory.get_nodes(3, opts=opts)
l1.fundwallet(10**7)
l3.fundwallet(10**7)
l1.connect(l2)
l3.connect(l1)

l1.rpc.fundchannel(l2.info['id'], 10**6, reserve='0sat')
l3.rpc.fundchannel(l1.info['id'], 10**6)

0 comments on commit 1cb92f7

Please sign in to comment.