From 5d3288183b69fe06175dea0992b68bf782d128cc Mon Sep 17 00:00:00 2001 From: 0xSpuddy Date: Wed, 31 Jan 2024 14:56:37 -0500 Subject: [PATCH] styles and typing --- .../sources/price/spot/uniswapV3Pool.py | 14 +------------- tests/feeds/test_wsteth_feed.py | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/telliot_feeds/sources/price/spot/uniswapV3Pool.py b/src/telliot_feeds/sources/price/spot/uniswapV3Pool.py index ab2547fd..109004c0 100644 --- a/src/telliot_feeds/sources/price/spot/uniswapV3Pool.py +++ b/src/telliot_feeds/sources/price/spot/uniswapV3Pool.py @@ -13,14 +13,6 @@ logger = get_logger(__name__) - -""" -Use the UniswapV3 subgraph playground to determine -if the spot price asset is token0 or token1. -Add the pool's contract address to either the -uniswapV3token0_map or uniswapV3token1_map accordingly -https://thegraph.com/hosted-service/subgraph/uniswap/uniswap-v3 -""" uniswapV3token0__pool_map = { "oeth": "0x52299416c469843f4e0d54688099966a6c7d720f", } @@ -42,16 +34,12 @@ def __init__(self, **kwargs: Any) -> None: async def get_price(self, asset: str, currency: str) -> OptionalDataPoint[float]: """Implement PriceServiceInterface - This implementation gets the price from the UniswapV3 subgraph using the pool query https://docs.uniswap.org/sdk/subgraph/subgraph-examples """ - asset = asset.lower() - pool0 = uniswapV3token0__pool_map.get(asset, None) - pool1 = uniswapV3token1__pool_map.get(asset, None) if not pool0 and not pool1: @@ -100,7 +88,7 @@ async def get_price(self, asset: str, currency: str) -> OptionalDataPoint[float] msg = "Error parsing UniswapV3 pool response: KeyError: {}".format(e) logger.critical(msg) return None, None - + else: raise Exception("Invalid response from get_url") diff --git a/tests/feeds/test_wsteth_feed.py b/tests/feeds/test_wsteth_feed.py index 1963907d..e4bb1e72 100644 --- a/tests/feeds/test_wsteth_feed.py +++ b/tests/feeds/test_wsteth_feed.py @@ -3,7 +3,6 @@ import pytest from telliot_feeds.feeds.wsteth_feed import wsteth_eth_median_feed -from telliot_feeds.feeds.wsteth_feed import wsteth_usd_median_feed @pytest.mark.asyncio