fix countEvents

This commit is contained in:
tecnovert
2026-01-19 11:05:26 +02:00
parent 1346d47d17
commit 52da86bc86

View File

@@ -3271,7 +3271,9 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
self.log.debug(f"logBidEvent {self.log.id(bid_id)} {event_type}") self.log.debug(f"logBidEvent {self.log.id(bid_id)} {event_type}")
self.logEvent(Concepts.BID, bid_id, event_type, event_msg, cursor) self.logEvent(Concepts.BID, bid_id, event_type, event_msg, cursor)
def countEvents(self, linked_type: int, linked_id: bytes, event_type: int, cursor): def countEvents(
self, linked_type: int, linked_id: bytes, event_type: int, cursor
) -> int:
q = cursor.execute( q = cursor.execute(
"SELECT COUNT(*) FROM eventlog WHERE linked_type = :linked_type AND linked_id = :linked_id AND event_type = :event_type", "SELECT COUNT(*) FROM eventlog WHERE linked_type = :linked_type AND linked_id = :linked_id AND event_type = :event_type",
{ {
@@ -3282,8 +3284,8 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
).fetchone() ).fetchone()
return q[0] return q[0]
def countBidEvents(self, bid, event_type: int, cursor): def countBidEvents(self, bid, event_type: int, cursor) -> int:
return self.countEvents(int(Concepts.BID), bid.bid_id, int(event_type)) return self.countEvents(int(Concepts.BID), bid.bid_id, int(event_type), cursor)
def getEvents(self, linked_type: int, linked_id: bytes): def getEvents(self, linked_type: int, linked_id: bytes):
events = [] events = []