Skip to content

Commit

Permalink
Merge pull request #47 from blocknative/fix/case-no-abi
Browse files Browse the repository at this point in the history
Fix parsing when no abi is present
  • Loading branch information
taylorjdawson authored Jul 2, 2022
2 parents b750e05 + 3e7e778 commit 9fb3d52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion blocknative/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.2.7'
__version__ = '0.2.8'
7 changes: 5 additions & 2 deletions blocknative/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def subscribe_address(
address: str,
callback: Callback,
filters: List[dict] = None,
abi: List[dict] = None,
abi: Union[List[dict], str] = None,
):
"""Subscribes to an address to listen to any incoming and
outgoing transactions that occur on that address.
Expand All @@ -140,10 +140,13 @@ def subscribe_address(
if self.blockchain == BN_ETHEREUM:
address = address.lower()

if isinstance(abi, str):
abi = json.loads(abi)

# Add this subscription to the registry
self._subscription_registry[address] = Subscription(
callback,
{"filters": filters, "abi": json.loads(abi)},
{"filters": filters, "abi": abi},
SubscriptionType.ADDRESS,
)

Expand Down

0 comments on commit 9fb3d52

Please sign in to comment.