Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: price pusher circular deps #240

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading