-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b79e27
commit 0997a02
Showing
23 changed files
with
747 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
import logging | ||
from typing import Any | ||
|
||
from dipdup.config import HandlerConfig | ||
from dipdup.context import HandlerContext | ||
from dipdup.index import Index | ||
logger = logging.getLogger('bridge_indexer.handlers.batch') | ||
|
||
from bridge_indexer.handlers.bridge_matcher import BridgeMatcher | ||
|
||
logger = logging.getLogger('bridge_indexer.handlers.batch') | ||
from collections.abc import Iterable | ||
|
||
from dipdup.context import HandlerContext | ||
from dipdup.index import MatchedHandler | ||
|
||
async def batch( | ||
ctx: HandlerContext, | ||
handlers: tuple[tuple[Index[Any, Any, Any], HandlerConfig, Any]], | ||
handlers: Iterable[MatchedHandler], | ||
) -> None: | ||
for index, handler, data in handlers: | ||
await index._call_matched_handler(handler, data) | ||
|
||
await BridgeMatcher.check_pending_transactions() | ||
for handler in handlers: | ||
await ctx.fire_matched_handler(handler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
class BridgeMatcherLocks: | ||
pending_tezos_deposits: bool = False | ||
pending_etherlink_withdrawals: bool = False | ||
pending_etherlink_deposits: bool = False | ||
pending_etherlink_xtz_deposits: bool = False | ||
pending_tezos_withdrawals: bool = False | ||
pending_inbox: bool = False | ||
pending_outbox: bool = False | ||
|
||
@classmethod | ||
def set_pending_tezos_deposits(cls): | ||
BridgeMatcherLocks.pending_tezos_deposits = True | ||
|
||
@classmethod | ||
def set_pending_etherlink_withdrawals(cls): | ||
BridgeMatcherLocks.pending_etherlink_withdrawals = True | ||
|
||
@classmethod | ||
def set_pending_etherlink_deposits(cls): | ||
BridgeMatcherLocks.pending_etherlink_deposits = True | ||
|
||
@classmethod | ||
def set_pending_etherlink_xtz_deposits(cls): | ||
BridgeMatcherLocks.pending_etherlink_xtz_deposits = True | ||
|
||
@classmethod | ||
def set_pending_tezos_withdrawals(cls): | ||
BridgeMatcherLocks.pending_tezos_withdrawals = True | ||
|
||
@classmethod | ||
def set_pending_inbox(cls): | ||
BridgeMatcherLocks.pending_inbox = True | ||
|
||
@classmethod | ||
def set_pending_outbox(cls): | ||
BridgeMatcherLocks.pending_outbox = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.