elements: Give pytest some information about the test chain

We are checking against chain-dependent constants, so let's make sure we are
using the ones for the correct chain.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2019-05-06 20:50:11 +02:00
committed by Rusty Russell
parent b016ce94e8
commit cd93a855ce
3 changed files with 33 additions and 9 deletions

View File

@@ -305,3 +305,25 @@ def executor(teardown_checks):
ex = futures.ThreadPoolExecutor(max_workers=20)
yield ex
ex.shutdown(wait=False)
@pytest.fixture
def chainparams():
chainparams = {
'regtest': {
"bip173_prefix": "bcrt",
"elements": False,
"name": "regtest",
"p2sh_prefix": '2',
"elements": False,
},
'liquid-regtest': {
"bip173_prefix": "ert",
"elements": True,
"name": "liquid-regtest",
"p2sh_prefix": 'X',
"elements": True,
}
}
return chainparams[config['TEST_NETWORK']]