tests: remove EXPERIMENTAL_FEATURE flag from openchannel2 hooks

These are now included in all builds
This commit is contained in:
niftynei 2021-04-20 15:44:45 -05:00 committed by Rusty Russell
parent 15e83925e8
commit 0e753224ae
4 changed files with 20 additions and 40 deletions

View File

@ -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,7 +16,6 @@ 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"

View File

@ -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,7 +55,6 @@ 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 """

View File

@ -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,7 +17,6 @@ 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"

View File

@ -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,7 +24,6 @@ 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())))