pytest: increase channel sizes so they reach min capacity with option_anchor_outputs

With a feerate of 7500perkw and subtracting 660 sats for anchors, a
20,000 sat channel has capacity about 9800 sat, below our default:

	You gave bad parameters: channel capacity with funding 20000sat, reserves 546sat/546sat, max_htlc_value_in_flight_msat is 18446744073709551615msat, channel capacity is 9818sat, which is below 10000000msat

So bump channel amounts.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2020-08-25 14:16:35 +09:30 committed by neil saitug
parent 9fabf614f4
commit 74e960c20b
5 changed files with 15 additions and 15 deletions

View File

@ -251,12 +251,12 @@ def test_disconnect_opener(node_factory):
for d in disconnects:
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
with pytest.raises(RpcError):
l1.rpc.fundchannel(l2.info['id'], 20000)
l1.rpc.fundchannel(l2.info['id'], 25000)
assert l1.rpc.getpeer(l2.info['id']) is None
# This one will succeed.
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
l1.rpc.fundchannel(l2.info['id'], 20000)
l1.rpc.fundchannel(l2.info['id'], 25000)
# Should still only have one peer!
assert len(l1.rpc.listpeers()) == 1
@ -277,12 +277,12 @@ def test_disconnect_fundee(node_factory):
for d in disconnects:
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
with pytest.raises(RpcError):
l1.rpc.fundchannel(l2.info['id'], 20000)
l1.rpc.fundchannel(l2.info['id'], 25000)
assert l1.rpc.getpeer(l2.info['id']) is None
# This one will succeed.
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
l1.rpc.fundchannel(l2.info['id'], 20000)
l1.rpc.fundchannel(l2.info['id'], 25000)
# Should still only have one peer!
assert len(l1.rpc.listpeers()) == 1
@ -301,7 +301,7 @@ def test_disconnect_half_signed(node_factory):
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
with pytest.raises(RpcError):
l1.rpc.fundchannel(l2.info['id'], 20000)
l1.rpc.fundchannel(l2.info['id'], 25000)
# Peer remembers, opener doesn't.
assert l1.rpc.getpeer(l2.info['id']) is None
@ -319,7 +319,7 @@ def test_reconnect_signed(node_factory):
l1.fundwallet(2000000)
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
l1.rpc.fundchannel(l2.info['id'], 20000)
l1.rpc.fundchannel(l2.info['id'], 25000)
# They haven't forgotten each other.
assert l1.rpc.getpeer(l2.info['id'])['id'] == l2.info['id']
@ -348,7 +348,7 @@ def test_reconnect_openingd(node_factory):
# l2 closes on l1, l1 forgets.
with pytest.raises(RpcError):
l1.rpc.fundchannel(l2.info['id'], 20000)
l1.rpc.fundchannel(l2.info['id'], 25000)
assert l1.rpc.getpeer(l2.info['id']) is None
# Reconnect.
@ -359,7 +359,7 @@ def test_reconnect_openingd(node_factory):
l2.daemon.wait_for_log('openingd.*Handed peer, entering loop')
# Should work fine.
l1.rpc.fundchannel(l2.info['id'], 20000)
l1.rpc.fundchannel(l2.info['id'], 25000)
l1.daemon.wait_for_log('sendrawtx exit 0')
l1.bitcoin.generate_block(3)

View File

@ -462,11 +462,11 @@ def test_routing_gossip_reconnect(node_factory):
{'may_reconnect': True},
{}])
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
l1.openchannel(l2, 20000)
l1.openchannel(l2, 25000)
# Now open new channels and everybody should sync
l2.rpc.connect(l3.info['id'], 'localhost', l3.port)
l2.openchannel(l3, 20000)
l2.openchannel(l3, 25000)
# Settle the gossip
for n in [l1, l2, l3]:
@ -508,7 +508,7 @@ def test_routing_gossip(node_factory, bitcoind):
for i in range(len(nodes) - 1):
src, dst = nodes[i], nodes[i + 1]
src.rpc.connect(dst.info['id'], 'localhost', dst.port)
src.openchannel(dst, 20000)
src.openchannel(dst, 25000)
# Allow announce messages.
bitcoind.generate_block(5)

View File

@ -467,7 +467,7 @@ def test_bech32_funding(node_factory, chainparams):
l1, l2 = node_factory.line_graph(2, opts={'random_hsm': True}, fundchannel=False)
# fund a bech32 address and then open a channel with it
res = l1.openchannel(l2, 20000, 'bech32')
res = l1.openchannel(l2, 25000, 'bech32')
address = res['address']
assert address.startswith(chainparams['bip173_prefix'])

View File

@ -1383,7 +1383,7 @@ def test_forward_local_failed_stats(node_factory, bitcoind, executor):
c12 = l1.fund_channel(l2, 10**6)
c23 = l2.fund_channel(l3, 10**6)
c24 = l2.fund_channel(l4, 10**6)
c25 = l2.fund_channel(l5, 10**4 * 2)
c25 = l2.fund_channel(l5, 10**4 * 3)
l6.fund_channel(l1, 10**6)
# Make sure routes finalized.

View File

@ -1211,9 +1211,9 @@ def test_bcli(node_factory, bitcoind, chainparams):
l1.fundwallet(10**5)
l1.connect(l2)
fc = l1.rpc.fundchannel(l2.info["id"], 10**4 * 2)
fc = l1.rpc.fundchannel(l2.info["id"], 10**4 * 3)
txo = l1.rpc.call("getutxout", {"txid": fc['txid'], "vout": fc['outnum']})
assert (Millisatoshi(txo["amount"]) == Millisatoshi(10**4 * 2 * 10**3)
assert (Millisatoshi(txo["amount"]) == Millisatoshi(10**4 * 3 * 10**3)
and txo["script"].startswith("0020"))
l1.rpc.close(l2.info["id"])
# When output is spent, it should give us null !