Browse Source

fix tests (follow-up)

follow-up 197979063a
master
SomberNight 2 years ago
parent
commit
d01582d58c
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 1
      electrum/channel_db.py
  2. 6
      tests/test_lnpeer.py

1
electrum/channel_db.py

@ -321,6 +321,7 @@ class ChannelDB(SqlDB):
self.lock = threading.RLock()
self.num_nodes = 0
self.num_channels = 0
self.num_policies = 0
self._channel_updates_for_private_channels = {} # type: Dict[Tuple[bytes, bytes], Tuple[dict, int]]
# note: ^ we could maybe move this cache into PaySession instead of being global.
# That would only make sense though if PaySessions were never too short

6
tests/test_lnpeer.py

@ -67,6 +67,7 @@ class MockNetwork:
self.channel_db = ChannelDB(self)
self.channel_db.data_loaded.set()
self.path_finder = LNPathFinder(self.channel_db)
self.lngossip = MockLNGossip()
self.tx_queue = tx_queue
self._blockchain = MockBlockchain()
@ -129,6 +130,11 @@ class MockWallet:
return ''
class MockLNGossip:
def get_sync_progress_estimate(self):
return None, None, None
class MockLNWallet(Logger, EventListener, NetworkRetryManager[LNPeerAddr]):
MPP_EXPIRY = 2 # HTLC timestamps are cast to int, so this cannot be 1
PAYMENT_TIMEOUT = 120

Loading…
Cancel
Save