Skip to content

Commit

Permalink
fix tests (follow-up)
Browse files Browse the repository at this point in the history
follow-up 1979790
  • Loading branch information
SomberNight committed Feb 22, 2024
1 parent 70b9ea2 commit d01582d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions electrum/channel_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ def __init__(self, network: 'Network'):
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
Expand Down
6 changes: 6 additions & 0 deletions tests/test_lnpeer.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def __init__(self, tx_queue, *, config: SimpleConfig):
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()

Expand Down Expand Up @@ -129,6 +130,11 @@ def get_fingerprint(self):
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
Expand Down

0 comments on commit d01582d

Please sign in to comment.