Skip to content

Commit

Permalink
fix: price-pusher circular deps (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvolveArt authored Jan 8, 2025
1 parent 641bffe commit ae63782
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion price-pusher/price_pusher/core/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from price_pusher.utils import exclude_none_and_exceptions, flatten_list
from price_pusher.configs import PriceConfig
from price_pusher.core.request_handlers.interface import IRequestHandler
from price_pusher.types import (
from price_pusher.price_types import (
DurationInSeconds,
LatestOraclePairPrices,
LatestOrchestratorPairPrices,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Dict

from price_pusher.types import Target
from price_pusher.price_types import Target

from .api import APIRequestHandler
from .chain import ChainRequestHandler
Expand Down
2 changes: 1 addition & 1 deletion price-pusher/price_pusher/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
PriceConfig,
)
from price_pusher.orchestrator import Orchestrator
from price_pusher.types import Target, Network
from price_pusher.price_types import Target, Network

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion price-pusher/price_pusher/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from price_pusher.core.poller import PricePoller
from price_pusher.core.listener import PriceListener
from price_pusher.core.pusher import PricePusher
from price_pusher.types import LatestOrchestratorPairPrices
from price_pusher.price_types import LatestOrchestratorPairPrices

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
]
LatestOraclePairPrices = Dict[PairId, Dict[DataTypes, Entry]]
Target = Literal["onchain", "offchain"]
Network = Literal["mainnet", "sepolia", "pragma_devnet"]
Network = Literal["mainnet", "sepolia", "pragma_devnet"]
7 changes: 4 additions & 3 deletions price-pusher/price_pusher/utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from typing import List, Union, Optional
from typing import List, Union, Optional, TypeVar

from pragma_sdk.offchain.client import PragmaAPIError

T = TypeVar('T')

def exclude_none_and_exceptions[T](
def exclude_none_and_exceptions(
to_filter: List[Optional[Union[T, BaseException, Exception, PragmaAPIError]]],
) -> List[T]:
"""
Expand All @@ -13,7 +14,7 @@ def exclude_none_and_exceptions[T](
return [item for item in to_filter if not isinstance(item, exception_types)]


def flatten_list[T](to_flatten: List[Union[T, List[T]]]) -> List[T]:
def flatten_list(to_flatten: List[Union[T, List[T]]]) -> List[T]:
"""
Flatten a list that contains items and list of items into a list of items.
"""
Expand Down

0 comments on commit ae63782

Please sign in to comment.