regtests: in py ctx, refer to configvars directly, not as str literals
though in the bash script, we cannot do this
This commit is contained in:
@@ -2,8 +2,13 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from typing import Mapping, Any
|
||||||
|
|
||||||
|
from electrum.simple_config import SimpleConfig
|
||||||
|
|
||||||
|
|
||||||
class TestLightning(unittest.TestCase):
|
class TestLightning(unittest.TestCase):
|
||||||
|
agents: Mapping[str, Mapping[str, Any]]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def run_shell(args, timeout=30):
|
def run_shell(args, timeout=30):
|
||||||
@@ -46,7 +51,7 @@ class TestLightningAB(TestLightning):
|
|||||||
'alice': {
|
'alice': {
|
||||||
},
|
},
|
||||||
'bob': {
|
'bob': {
|
||||||
'lightning_listen': 'localhost:9735',
|
SimpleConfig.LIGHTNING_LISTEN.key(): 'localhost:9735',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,15 +83,15 @@ class TestLightningAB(TestLightning):
|
|||||||
class TestLightningSwapserver(TestLightning):
|
class TestLightningSwapserver(TestLightning):
|
||||||
agents = {
|
agents = {
|
||||||
'alice': {
|
'alice': {
|
||||||
'use_gossip': 'false',
|
SimpleConfig.LIGHTNING_USE_GOSSIP.key(): 'false',
|
||||||
'swapserver_url': 'http://localhost:5455',
|
SimpleConfig.SWAPSERVER_URL.key(): 'http://localhost:5455',
|
||||||
'nostr_relays': "''",
|
SimpleConfig.NOSTR_RELAYS.key(): "''",
|
||||||
},
|
},
|
||||||
'bob': {
|
'bob': {
|
||||||
'lightning_listen': 'localhost:9735',
|
SimpleConfig.LIGHTNING_LISTEN.key(): 'localhost:9735',
|
||||||
'enable_plugin_swapserver': 'true',
|
'enable_plugin_swapserver': 'true',
|
||||||
'swapserver_port': '5455',
|
SimpleConfig.SWAPSERVER_PORT.key(): '5455',
|
||||||
'nostr_relays': "''",
|
SimpleConfig.NOSTR_RELAYS.key(): "''",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,17 +108,17 @@ class TestLightningSwapserver(TestLightning):
|
|||||||
|
|
||||||
class TestLightningWatchtower(TestLightning):
|
class TestLightningWatchtower(TestLightning):
|
||||||
agents = {
|
agents = {
|
||||||
'alice':{
|
'alice': {
|
||||||
},
|
},
|
||||||
'bob':{
|
'bob': {
|
||||||
'lightning_listen': 'localhost:9735',
|
SimpleConfig.LIGHTNING_LISTEN.key(): 'localhost:9735',
|
||||||
'watchtower_url': 'http://wtuser:wtpassword@127.0.0.1:12345',
|
SimpleConfig.WATCHTOWER_CLIENT_URL.key(): 'http://wtuser:wtpassword@127.0.0.1:12345',
|
||||||
},
|
},
|
||||||
'carol':{
|
'carol': {
|
||||||
'enable_plugin_watchtower': 'true',
|
'enable_plugin_watchtower': 'true',
|
||||||
'watchtower_user': 'wtuser',
|
SimpleConfig.WATCHTOWER_SERVER_USER.key(): 'wtuser',
|
||||||
'watchtower_password': 'wtpassword',
|
SimpleConfig.WATCHTOWER_SERVER_PASSWORD.key(): 'wtpassword',
|
||||||
'watchtower_port': '12345',
|
SimpleConfig.WATCHTOWER_SERVER_PORT.key(): '12345',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,15 +128,15 @@ class TestLightningWatchtower(TestLightning):
|
|||||||
|
|
||||||
class TestLightningJIT(TestLightning):
|
class TestLightningJIT(TestLightning):
|
||||||
agents = {
|
agents = {
|
||||||
'alice':{
|
'alice': {
|
||||||
'accept_zeroconf_channels': 'true',
|
SimpleConfig.ACCEPT_ZEROCONF_CHANNELS.key(): 'true',
|
||||||
},
|
},
|
||||||
'bob':{
|
'bob': {
|
||||||
'lightning_listen': 'localhost:9735',
|
SimpleConfig.LIGHTNING_LISTEN.key(): 'localhost:9735',
|
||||||
'lightning_forward_payments': 'true',
|
SimpleConfig.EXPERIMENTAL_LN_FORWARD_PAYMENTS.key(): 'true',
|
||||||
'accept_zeroconf_channels': 'true',
|
SimpleConfig.ACCEPT_ZEROCONF_CHANNELS.key(): 'true',
|
||||||
},
|
},
|
||||||
'carol':{
|
'carol': {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,17 +146,17 @@ class TestLightningJIT(TestLightning):
|
|||||||
|
|
||||||
class TestLightningJITTrampoline(TestLightningJIT):
|
class TestLightningJITTrampoline(TestLightningJIT):
|
||||||
agents = {
|
agents = {
|
||||||
'alice':{
|
'alice': {
|
||||||
'use_gossip': 'false',
|
SimpleConfig.LIGHTNING_USE_GOSSIP.key(): 'false',
|
||||||
'accept_zeroconf_channels': 'true',
|
SimpleConfig.ACCEPT_ZEROCONF_CHANNELS.key(): 'true',
|
||||||
},
|
},
|
||||||
'bob':{
|
'bob': {
|
||||||
'lightning_listen': 'localhost:9735',
|
SimpleConfig.LIGHTNING_LISTEN.key(): 'localhost:9735',
|
||||||
'lightning_forward_payments': 'true',
|
SimpleConfig.EXPERIMENTAL_LN_FORWARD_PAYMENTS.key(): 'true',
|
||||||
'lightning_forward_trampoline_payments': 'true',
|
SimpleConfig.EXPERIMENTAL_LN_FORWARD_TRAMPOLINE_PAYMENTS.key(): 'true',
|
||||||
'accept_zeroconf_channels': 'true',
|
SimpleConfig.ACCEPT_ZEROCONF_CHANNELS.key(): 'true',
|
||||||
},
|
},
|
||||||
'carol':{
|
'carol': {
|
||||||
'use_gossip': 'false',
|
SimpleConfig.LIGHTNING_USE_GOSSIP.key(): 'false',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user