From 21b9bec93b0dbb48c087817568910eefb6621e6d Mon Sep 17 00:00:00 2001 From: niftynei Date: Mon, 14 Dec 2020 17:57:53 -0600 Subject: [PATCH] df-tests: test_channel_state_change_history --- tests/test_plugin.py | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index e110b7349..18f68af73 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -871,16 +871,31 @@ def test_channel_state_change_history(node_factory, bitcoind): bitcoind.generate_block(100) # so it gets settled history = l1.rpc.listpeers()['peers'][0]['channels'][0]['state_changes'] - assert(history[0]['cause'] == "user") - assert(history[0]['old_state'] == "CHANNELD_AWAITING_LOCKIN") - assert(history[0]['new_state'] == "CHANNELD_NORMAL") - assert(history[1]['cause'] == "user") - assert(history[1]['new_state'] == "CHANNELD_SHUTTING_DOWN") - assert(history[2]['cause'] == "user") - assert(history[2]['new_state'] == "CLOSINGD_SIGEXCHANGE") - assert(history[3]['cause'] == "user") - assert(history[3]['new_state'] == "CLOSINGD_COMPLETE") - assert(history[3]['message'] == "Closing complete") + if l1.config('experimental-dual-fund'): + assert(history[0]['cause'] == "user") + assert(history[0]['old_state'] == "DUALOPEND_OPEN_INIT") + assert(history[0]['new_state'] == "DUALOPEND_AWAITING_LOCKIN") + assert(history[1]['cause'] == "user") + assert(history[1]['old_state'] == "DUALOPEND_AWAITING_LOCKIN") + assert(history[1]['new_state'] == "CHANNELD_NORMAL") + assert(history[2]['cause'] == "user") + assert(history[2]['new_state'] == "CHANNELD_SHUTTING_DOWN") + assert(history[3]['cause'] == "user") + assert(history[3]['new_state'] == "CLOSINGD_SIGEXCHANGE") + assert(history[4]['cause'] == "user") + assert(history[4]['new_state'] == "CLOSINGD_COMPLETE") + assert(history[4]['message'] == "Closing complete") + else: + assert(history[0]['cause'] == "user") + assert(history[0]['old_state'] == "CHANNELD_AWAITING_LOCKIN") + assert(history[0]['new_state'] == "CHANNELD_NORMAL") + assert(history[1]['cause'] == "user") + assert(history[1]['new_state'] == "CHANNELD_SHUTTING_DOWN") + assert(history[2]['cause'] == "user") + assert(history[2]['new_state'] == "CLOSINGD_SIGEXCHANGE") + assert(history[3]['cause'] == "user") + assert(history[3]['new_state'] == "CLOSINGD_COMPLETE") + assert(history[3]['message'] == "Closing complete") @unittest.skipIf(not DEVELOPER, "without DEVELOPER=1, gossip v slow")