pytest: enable deprecated APIs for multi-arg closes.

We're about to change the API, so this makes the tests still work
across the transition (and, as a bonus, tests our backwards compat
shim).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2019-08-07 14:14:54 +09:30
parent dfac1d15a2
commit b35dc4689b
3 changed files with 13 additions and 12 deletions

View File

@ -13,7 +13,7 @@ import unittest
@unittest.skipIf(not DEVELOPER, "Too slow without --dev-bitcoind-poll")
def test_closing(node_factory, bitcoind):
l1, l2 = node_factory.line_graph(2)
l1, l2 = node_factory.line_graph(2, opts={'allow-deprecated-apis': True})
chan = l1.get_channel_scid(l2)
l1.pay(l2, 200000000)
@ -98,7 +98,7 @@ def test_closing(node_factory, bitcoind):
def test_closing_while_disconnected(node_factory, bitcoind):
l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True})
l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True, 'allow-deprecated-apis': True})
chan = l1.get_channel_scid(l2)
l1.pay(l2, 200000000)
@ -147,7 +147,7 @@ def test_closing_id(node_factory):
@unittest.skipIf(not DEVELOPER, "needs dev-rescan-outputs")
def test_closing_torture(node_factory, executor, bitcoind):
l1, l2 = node_factory.get_nodes(2)
l1, l2 = node_factory.get_nodes(2, opts={'allow-deprecated-apis': True})
amount = 10**6
# Before the fix was applied, 15 would often pass.
@ -197,7 +197,7 @@ def test_closing_torture(node_factory, executor, bitcoind):
@unittest.skipIf(SLOW_MACHINE and VALGRIND, "slow test")
def test_closing_different_fees(node_factory, bitcoind, executor):
l1 = node_factory.get_node()
l1 = node_factory.get_node(options={'allow-deprecated-apis': True})
# Default feerate = 15000/7500/1000
# It will start at the second number, accepting anything above the first.
@ -215,7 +215,7 @@ def test_closing_different_fees(node_factory, bitcoind, executor):
peers = []
for feerate in feerates:
for amount in amounts:
p = node_factory.get_node(feerates=feerate)
p = node_factory.get_node(feerates=feerate, options={'allow-deprecated-apis': True})
p.feerate = feerate
p.amount = amount
l1.rpc.connect(p.info['id'], 'localhost', p.port)
@ -265,7 +265,7 @@ def test_closing_negotiation_reconnect(node_factory, bitcoind):
disconnects = ['-WIRE_CLOSING_SIGNED',
'@WIRE_CLOSING_SIGNED',
'+WIRE_CLOSING_SIGNED']
l1 = node_factory.get_node(disconnect=disconnects, may_reconnect=True)
l1 = node_factory.get_node(disconnect=disconnects, may_reconnect=True, options={'allow-deprecated-apis': True})
l2 = node_factory.get_node(may_reconnect=True)
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)

View File

@ -577,7 +577,8 @@ def test_shutdown_reconnect(node_factory):
'@WIRE_SHUTDOWN',
'+WIRE_SHUTDOWN']
l1 = node_factory.get_node(disconnect=disconnects,
may_reconnect=True)
may_reconnect=True,
options={'allow-deprecated-apis': True})
l2 = node_factory.get_node(may_reconnect=True)
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
@ -637,7 +638,7 @@ def test_reconnect_remote_sends_no_sigs(node_factory):
def test_shutdown_awaiting_lockin(node_factory, bitcoind):
l1 = node_factory.get_node()
l1 = node_factory.get_node(options={'allow-deprecated-apis': True})
l2 = node_factory.get_node(options={'funding-confirms': 3})
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
@ -1128,7 +1129,7 @@ def test_channel_reenable(node_factory):
@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")
def test_update_fee(node_factory, bitcoind):
l1, l2 = node_factory.line_graph(2, fundchannel=True)
l1, l2 = node_factory.line_graph(2, fundchannel=True, opts={'allow-deprecated-apis': True})
chanid = l1.get_channel_scid(l2)
# Make l1 send out feechange.
@ -1312,7 +1313,7 @@ def test_forget_channel(node_factory):
def test_peerinfo(node_factory, bitcoind):
l1, l2 = node_factory.line_graph(2, fundchannel=False, opts={'may_reconnect': True})
l1, l2 = node_factory.line_graph(2, fundchannel=False, opts={'may_reconnect': True, 'allow-deprecated-apis': True})
lfeatures = 'aa'
# Gossiping but no node announcement yet
assert l1.rpc.getpeer(l2.info['id'])['connected']

View File

@ -1165,7 +1165,7 @@ def test_forward_local_failed_stats(node_factory, bitcoind, executor):
disconnects = ['-WIRE_UPDATE_FAIL_HTLC', 'permfail']
l1 = node_factory.get_node()
l2 = node_factory.get_node()
l2 = node_factory.get_node(options={'allow-deprecated-apis': True})
l3 = node_factory.get_node()
l4 = node_factory.get_node(disconnect=disconnects)
l5 = node_factory.get_node()
@ -1824,7 +1824,7 @@ def test_setchannelfee_state(node_factory, bitcoind):
l0 = node_factory.get_node(options={'fee-base': DEF_BASE, 'fee-per-satoshi': DEF_PPM})
l1 = node_factory.get_node(options={'fee-base': DEF_BASE, 'fee-per-satoshi': DEF_PPM})
l2 = node_factory.get_node(options={'fee-base': DEF_BASE, 'fee-per-satoshi': DEF_PPM})
l2 = node_factory.get_node(options={'fee-base': DEF_BASE, 'fee-per-satoshi': DEF_PPM, 'allow-deprecated-apis': True})
# connection and funding
l0.rpc.connect(l1.info['id'], 'localhost', l1.port)