From 385f3d3ff648afa533f3696c644c1b320853e632 Mon Sep 17 00:00:00 2001 From: Platon Floria Date: Mon, 27 May 2024 19:17:43 +0800 Subject: [PATCH] fix: solidly subscriptions --- fastlane_bot/events/exchanges/solidly_v2/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fastlane_bot/events/exchanges/solidly_v2/base.py b/fastlane_bot/events/exchanges/solidly_v2/base.py index 7bffef541..693c82197 100644 --- a/fastlane_bot/events/exchanges/solidly_v2/base.py +++ b/fastlane_bot/events/exchanges/solidly_v2/base.py @@ -13,8 +13,9 @@ """ from abc import abstractmethod from dataclasses import dataclass -from typing import List, Type, Any +from typing import List, Type, Any, Union +from web3 import Web3, AsyncWeb3 from web3.contract import Contract, AsyncContract from fastlane_bot.data.abi import SOLIDLY_V2_POOL_ABI @@ -50,7 +51,8 @@ def add_pool(self, pool: Pool): def get_events(self, contract: Contract) -> List[Type[Contract]]: return [contract.events.Sync] if self.exchange_initialized else [] - def get_subscriptions(self, contract: Contract) -> List[Subscription]: + def get_subscriptions(self, w3: Union[Web3, AsyncWeb3]) -> List[Subscription]: + contract = self.get_event_contract(w3) return [Subscription(contract.events.Sync)] def get_abi(self):