From 78a074af5acfeb60fc5d58ae083ef4bec48801a7 Mon Sep 17 00:00:00 2001 From: ZmnSCPxj Date: Sat, 21 Apr 2018 12:29:18 +0000 Subject: [PATCH] test_lightningd: Also test receive of P2WPKH is correct. For completeness. Existing test will check P2SH-P2WPKH address only. P2WPKH seems OK but test it anyway in case of regression. --- tests/test_lightningd.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index 8c050c5f9..34cd0c920 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -3498,6 +3498,16 @@ class LightningDTests(BaseLightningDTests): output = l1.rpc.listfunds()['outputs'][0] assert output['address'] == addr + # Send all our money to a P2WPKH address this time. + addr = l1.rpc.newaddr("bech32")['address'] + l1.rpc.withdraw(addr, "all") + l1.bitcoin.rpc.generate(1) + time.sleep(1) + + # The address we detect must match what was paid to. + output = l1.rpc.listfunds()['outputs'][0] + assert output['address'] == addr + @unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1") def test_channel_persistence(self): # Start two nodes and open a channel (to remember). l2 will