diff --git a/tests/plugins/openchannel_hook_accept.py b/tests/plugins/openchannel_hook_accept.py index 0022179eb..9a8d1b877 100755 --- a/tests/plugins/openchannel_hook_accept.py +++ b/tests/plugins/openchannel_hook_accept.py @@ -5,14 +5,10 @@ Will simply accept any channel. Useful fot testing chained hook. """ from pyln.client import Plugin -from pyln.testing.utils import env plugin = Plugin() -EXPERIMENTAL_FEATURES = env("EXPERIMENTAL_FEATURES", "0") == "1" - - @plugin.hook('openchannel') def on_openchannel(openchannel, plugin, **kwargs): msg = "accept on principle" @@ -20,12 +16,11 @@ def on_openchannel(openchannel, plugin, **kwargs): return {'result': 'continue'} -if EXPERIMENTAL_FEATURES: - @plugin.hook('openchannel2') - def on_openchannel2(openchannel2, plugin, **kwargs): - msg = "accept on principle" - plugin.log(msg) - return {'result': 'continue'} +@plugin.hook('openchannel2') +def on_openchannel2(openchannel2, plugin, **kwargs): + msg = "accept on principle" + plugin.log(msg) + return {'result': 'continue'} plugin.run() diff --git a/tests/plugins/openchannel_hook_accepter.py b/tests/plugins/openchannel_hook_accepter.py index 9c0bd884e..bf63cf146 100755 --- a/tests/plugins/openchannel_hook_accepter.py +++ b/tests/plugins/openchannel_hook_accepter.py @@ -12,14 +12,10 @@ """ from pyln.client import Plugin, Millisatoshi -from pyln.testing.utils import env plugin = Plugin() -EXPERIMENTAL_FEATURES = env("EXPERIMENTAL_FEATURES", "0") == "1" - - def run_openchannel(funding_sats_str, plugin): # Convert from string to satoshis funding_sats = Millisatoshi(funding_sats_str).to_satoshi() @@ -59,11 +55,10 @@ def on_openchannel(openchannel, plugin, **kwargs): return run_openchannel(openchannel['funding_satoshis'], plugin) -if EXPERIMENTAL_FEATURES: - @plugin.hook('openchannel2') - def on_openchannel2(openchannel2, plugin, **kwargs): - """ Support for v2 channel opens """ - return run_openchannel(openchannel2['their_funding'], plugin) +@plugin.hook('openchannel2') +def on_openchannel2(openchannel2, plugin, **kwargs): + """ Support for v2 channel opens """ + return run_openchannel(openchannel2['their_funding'], plugin) plugin.run() diff --git a/tests/plugins/openchannel_hook_reject.py b/tests/plugins/openchannel_hook_reject.py index 93fe15e40..e9104cbab 100755 --- a/tests/plugins/openchannel_hook_reject.py +++ b/tests/plugins/openchannel_hook_reject.py @@ -6,10 +6,6 @@ Useful fot testing chained hook. """ from pyln.client import Plugin -from pyln.testing.utils import env - -EXPERIMENTAL_FEATURES = env("EXPERIMENTAL_FEATURES", "0") == "1" - plugin = Plugin() @@ -21,12 +17,11 @@ def on_openchannel(openchannel, plugin, **kwargs): return {'result': 'reject', 'error_message': msg} -if EXPERIMENTAL_FEATURES: - @plugin.hook('openchannel2') - def on_openchannel2(openchannel2, plugin, **kwargs): - msg = "reject on principle" - plugin.log(msg) - return {'result': 'reject', 'error_message': msg} +@plugin.hook('openchannel2') +def on_openchannel2(openchannel2, plugin, **kwargs): + msg = "reject on principle" + plugin.log(msg) + return {'result': 'reject', 'error_message': msg} plugin.run() diff --git a/tests/plugins/reject_odd_funding_amounts.py b/tests/plugins/reject_odd_funding_amounts.py index 3e72cb059..adf0efc00 100755 --- a/tests/plugins/reject_odd_funding_amounts.py +++ b/tests/plugins/reject_odd_funding_amounts.py @@ -5,14 +5,10 @@ We just refuse to let them open channels with an odd amount of millisatoshis. """ from pyln.client import Plugin, Millisatoshi -from pyln.testing.utils import env plugin = Plugin() -EXPERIMENTAL_FEATURES = env("EXPERIMENTAL_FEATURES", "0") == "1" - - def run_check(funding_amt_str): if Millisatoshi(funding_amt_str).to_satoshi() % 2 == 1: return {'result': 'reject', 'error_message': "I don't like odd amounts"} @@ -28,14 +24,13 @@ def on_openchannel(openchannel, plugin, **kwargs): return run_check(openchannel['funding_satoshis']) -if EXPERIMENTAL_FEATURES: - @plugin.hook('openchannel2') - def on_openchannel2(openchannel2, plugin, **kwargs): - print("{} VARS".format(len(openchannel2.keys()))) - for k in sorted(openchannel2.keys()): - print("{}={}".format(k, openchannel2[k])) +@plugin.hook('openchannel2') +def on_openchannel2(openchannel2, plugin, **kwargs): + print("{} VARS".format(len(openchannel2.keys()))) + for k in sorted(openchannel2.keys()): + print("{}={}".format(k, openchannel2[k])) - return run_check(openchannel2['their_funding']) + return run_check(openchannel2['their_funding']) plugin.run()