Swaps over Nostr
- Separation between SwapManager and its transport: Legacy transpport uses http, Nostr uses websockets - The transport uses a context to open/close connections. This context is not async, because it needs to be called from the GUI - Swapserver fees values are initialized to None instead of 0, so that any attempt to use them before the swap manager is initialized will raise an exception. - Remove swapserver fees disk caching (swap_pairs file) - Regtests use http transport - Android uses http transport (until QML is ready)
This commit is contained in:
@@ -79,10 +79,14 @@ class TestLightningSwapserver(TestLightning):
|
||||
agents = {
|
||||
'alice': {
|
||||
'use_gossip': 'false',
|
||||
'swapserver_url': 'http://localhost:5455',
|
||||
'nostr_relays': "''",
|
||||
},
|
||||
'bob': {
|
||||
'lightning_listen': 'localhost:9735',
|
||||
'enable_plugin_swapserver': 'true',
|
||||
'swapserver_port': '5455',
|
||||
'nostr_relays': "''",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -148,22 +148,6 @@ class Test_SimpleConfig(ElectrumTestCase):
|
||||
config.NETWORK_MAX_INCOMING_MSG_SIZE = None
|
||||
self.assertEqual(MAX_MSG_SIZE_DEFAULT, config.NETWORK_MAX_INCOMING_MSG_SIZE)
|
||||
|
||||
def test_configvars_get_default_value_complex_fn(self):
|
||||
config = SimpleConfig(self.options)
|
||||
self.assertEqual("https://swaps.electrum.org/api", config.SWAPSERVER_URL)
|
||||
|
||||
config.SWAPSERVER_URL = "http://localhost:9999"
|
||||
self.assertEqual("http://localhost:9999", config.SWAPSERVER_URL)
|
||||
|
||||
config.SWAPSERVER_URL = None
|
||||
self.assertEqual("https://swaps.electrum.org/api", config.SWAPSERVER_URL)
|
||||
|
||||
constants.BitcoinTestnet.set_as_network()
|
||||
try:
|
||||
self.assertEqual("https://swaps.electrum.org/testnet", config.SWAPSERVER_URL)
|
||||
finally:
|
||||
constants.BitcoinMainnet.set_as_network()
|
||||
|
||||
def test_configvars_convert_getter(self):
|
||||
config = SimpleConfig(self.options)
|
||||
self.assertEqual(None, config.NETWORK_PROXY)
|
||||
|
||||
Reference in New Issue
Block a user