diff --git a/fastlane_bot/helpers/poolandtokens.py b/fastlane_bot/helpers/poolandtokens.py index f8958c22e..b4c0dfa53 100644 --- a/fastlane_bot/helpers/poolandtokens.py +++ b/fastlane_bot/helpers/poolandtokens.py @@ -12,7 +12,7 @@ import math from _decimal import Decimal from dataclasses import dataclass -from typing import Dict, Any, List, Union +from typing import Dict, Any, List, Union, Tuple from fastlane_bot.config import Config @@ -397,7 +397,7 @@ def _other_to_cpc(self) -> List[Any]: class DoubleInvalidCurveError(ValueError): pass - def _carbon_to_cpc_and_type(self) -> ConstantProductCurve: + def _carbon_to_cpc_dict(self) -> Tuple[Dict, bool]: """ constructor: from a single Carbon order (see class docstring for other parameters)* @@ -499,11 +499,11 @@ def _carbon_to_cpc_and_type(self) -> ConstantProductCurve: if typed_args["yint"] < yint0: typed_args["yint"] = yint0 - return {'strategy_typed_args': strategy_typed_args, 'prices_overlap': prices_overlap} + return {"strategy_typed_args": strategy_typed_args, "prices_overlap": prices_overlap} def _carbon_to_cpc(self) -> ConstantProductCurve: cpc_list = [] - for typed_args in self._carbon_to_cpc_and_type()['strategy_typed_args']: + for typed_args in self._carbon_to_cpc_dict()["strategy_typed_args"]: try: cpc_list.append(ConstantProductCurve.from_carbon(**self._convert_to_float(typed_args))) except Exception as e: diff --git a/fastlane_bot/tests/test_059_PoolAndTokens.py b/fastlane_bot/tests/test_059_PoolAndTokens.py index 89926892f..24294dc36 100644 --- a/fastlane_bot/tests/test_059_PoolAndTokens.py +++ b/fastlane_bot/tests/test_059_PoolAndTokens.py @@ -67,7 +67,7 @@ def test_test_poolandtokens_carbon(): tkn0_decimals=strategy["tkn0_decimals"], tkn1_decimals=strategy["tkn1_decimals"], ) - prices_overlap = pool_and_tokens._carbon_to_cpc_and_type()["prices_overlap"] + prices_overlap = pool_and_tokens._carbon_to_cpc_dict()["prices_overlap"] expected = "overlapping" if strategy["overlap"] else "disjoint" actual = "overlapping" if prices_overlap else "disjoint" assert actual == expected, f"expected {expected} strategy, got {actual} strategy: {dumps(strategy,indent=4)}"