pytest: Test that we record forwardings correctly

Adapts the `test_forward_stats` test to include checks for the
`forwarded_payments` table. Will add checks for the `listforwardings`
RPC call next.

Signed-off-by: Christian Decker <@cdecker>
This commit is contained in:
Christian Decker
2018-10-17 15:37:15 +02:00
committed by Rusty Russell
parent 4b4c549c9d
commit 6efdd5275c
2 changed files with 67 additions and 20 deletions

View File

@@ -380,8 +380,12 @@ class LightningNode(object):
self.may_fail = may_fail
self.may_reconnect = may_reconnect
def openchannel(self, remote_node, capacity, addrtype="p2sh-segwit", confirm=True, announce=True):
def openchannel(self, remote_node, capacity, addrtype="p2sh-segwit", confirm=True, announce=True, connect=True):
addr, wallettxid = self.fundwallet(10 * capacity, addrtype)
if connect and remote_node.info['id'] not in [p['id'] for p in self.rpc.listpeers()['peers']]:
self.rpc.connect(remote_node.info['id'], '127.0.0.1', remote_node.daemon.port)
fundingtx = self.rpc.fundchannel(remote_node.info['id'], capacity)
# Wait for the funding transaction to be in bitcoind's mempool