From 465a12ffbe02366719c657ebe08e8bd228911fca Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 16 Sep 2019 19:10:26 +0200 Subject: [PATCH] elements: Parametrize tests to consider chainparams --- tests/test_closing.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_closing.py b/tests/test_closing.py index 82acd4bb0..5aed70d7a 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -12,9 +12,10 @@ import unittest @unittest.skipIf(not DEVELOPER, "Too slow without --dev-bitcoind-poll") -def test_closing(node_factory, bitcoind): +def test_closing(node_factory, bitcoind, chainparams): l1, l2 = node_factory.line_graph(2) chan = l1.get_channel_scid(l2) + fee = 5430 if not chainparams['elements'] else 8955 l1.pay(l2, 200000000) @@ -61,7 +62,7 @@ def test_closing(node_factory, bitcoind): billboard = only_one(l1.rpc.listpeers(l2.info['id'])['peers'][0]['channels'])['status'] assert billboard == [ - 'CLOSINGD_SIGEXCHANGE:We agreed on a closing fee of 5430 satoshi for tx:{}'.format(closetxid), + 'CLOSINGD_SIGEXCHANGE:We agreed on a closing fee of {} satoshi for tx:{}'.format(fee, closetxid), ] bitcoind.generate_block(1) @@ -73,14 +74,14 @@ def test_closing(node_factory, bitcoind): assert closetxid in set([o['txid'] for o in l2.rpc.listfunds()['outputs']]) wait_for(lambda: only_one(l1.rpc.listpeers(l2.info['id'])['peers'][0]['channels'])['status'] == [ - 'CLOSINGD_SIGEXCHANGE:We agreed on a closing fee of 5430 satoshi for tx:{}'.format(closetxid), + 'CLOSINGD_SIGEXCHANGE:We agreed on a closing fee of {} satoshi for tx:{}'.format(fee, closetxid), 'ONCHAIN:Tracking mutual close transaction', 'ONCHAIN:All outputs resolved: waiting 99 more blocks before forgetting channel' ]) bitcoind.generate_block(9) wait_for(lambda: only_one(l1.rpc.listpeers(l2.info['id'])['peers'][0]['channels'])['status'] == [ - 'CLOSINGD_SIGEXCHANGE:We agreed on a closing fee of 5430 satoshi for tx:{}'.format(closetxid), + 'CLOSINGD_SIGEXCHANGE:We agreed on a closing fee of {} satoshi for tx:{}'.format(fee, closetxid), 'ONCHAIN:Tracking mutual close transaction', 'ONCHAIN:All outputs resolved: waiting 90 more blocks before forgetting channel' ])