From 8173f61ebaf6548d8a9a4e28b69f9a244c364ad1 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Wed, 17 Jan 2024 18:18:22 -0500 Subject: [PATCH] fix: different Curve factory event keys on poly (#497) --- y/prices/stable_swap/curve.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/y/prices/stable_swap/curve.py b/y/prices/stable_swap/curve.py index 53d3af3f1..296d2bd62 100644 --- a/y/prices/stable_swap/curve.py +++ b/y/prices/stable_swap/curve.py @@ -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 @@ -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':