Skip to content

Commit

Permalink
fix: different Curve factory event keys on poly (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Jan 17, 2024
1 parent 6c2ef75 commit 8173f61
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions y/prices/stable_swap/curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import brownie
from brownie import ZERO_ADDRESS, chain
from brownie.convert.datatypes import EthAddress
from brownie.exceptions import ContractNotFound
from brownie.exceptions import ContractNotFound, EventLookupError
from brownie.network.event import _EventItem

from y import ENVIRONMENT_VARIABLES as ENVS
Expand Down Expand Up @@ -101,7 +101,10 @@ def registry(self) -> "Registry":
def _process_event(self, event: _EventItem) -> None:
if event.name == 'PoolAdded':
# TODO async this
pool = event['pool']
try:
pool = event['pool']
except EventLookupError:
pool = event['newPool']
self._tasks.append(asyncio.create_task(coro=self._add_pool(pool), name=f"Registry._add_pool for pool {pool}"))
self.registry.curve.registries[event.address].add(pool)
elif event.name == 'PoolRemoved':
Expand Down

0 comments on commit 8173f61

Please sign in to comment.