test: introduce the default port function and remove hard coded port

This commit is contained in:
Vincenzo Palazzo
2022-06-26 23:04:50 +00:00
committed by Rusty Russell
parent 7ff62b4a00
commit 2c9d7484a2
3 changed files with 20 additions and 8 deletions

View File

@@ -8,6 +8,16 @@ import time
EXPERIMENTAL_FEATURES = env("EXPERIMENTAL_FEATURES", "0") == "1"
COMPAT = env("COMPAT", "1") == "1"
def default_ln_port(network: str) -> int:
network_map = {
"bitcoin": 9735,
"testnet": 19735,
"regtest": 19846,
"signet": 39735,
"liquid-regtest": 20735,
"liquid": 9735,
}
return network_map[network]
def anchor_expected():
return EXPERIMENTAL_FEATURES or EXPERIMENTAL_DUAL_FUND