Skip to content

Commit

Permalink
next: Cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
akhercha committed Jul 4, 2024
1 parent ea7297d commit 21c5fce
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion price-pusher/tests/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from pragma.common.configs.asset_config import AssetConfig
from pragma.common.types.pair import Pair


Expand Down
6 changes: 4 additions & 2 deletions sdk/pragma/common/configs/asset_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def from_ticker(cls, ticker: str) -> Self:
:return: AssetConfig
"""

assets = filter(lambda x: x.ticker == ticker, ALL_ASSETS)
assets = filter(lambda x: x.ticker == ticker, ALL_ASSETS_CONFIGS)
try:
asset = next(assets)
return asset
Expand All @@ -72,4 +72,6 @@ def get_coingecko_id_from_ticker(ticker: str) -> str:
return asset.coingecko_id


ALL_ASSETS = AssetConfig.from_yaml(SUPPORTED_ASSETS_FILE_PATH)
ALL_ASSETS_CONFIGS: List[AssetConfig] = AssetConfig.from_yaml(
SUPPORTED_ASSETS_FILE_PATH
)
4 changes: 2 additions & 2 deletions sdk/pragma/common/fetchers/fetcher_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class FetcherClient:
The client works by setting up fetchers that are provided the assets to fetch and the publisher name.
```python
bitstamp_fetcher = BitstampFetcher(ALL_ASSETS, "publisher_test")
gateio_fetcher = GateIOFetcher(ALL_ASSETS, "publisher_test")
bitstamp_fetcher = BitstampFetcher(ALL_ASSETS_CONFIGS, "publisher_test")
gateio_fetcher = GateIOFetcher(ALL_ASSETS_CONFIGS, "publisher_test")
fetchers = [
bitstamp_fetcher,
Expand Down
6 changes: 3 additions & 3 deletions sdk/pragma/tests/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from pragma.common.types import Pair, SpotEntry
from pragma.common.configs.asset_config import (
ALL_ASSETS,
ALL_ASSETS_CONFIGS,
AssetConfig,
)
from pragma.onchain.types.types import OracleResponse
Expand Down Expand Up @@ -93,10 +93,10 @@ def find_repo_root(start_directory: Path) -> Path:

USD_ASSET_CONFIG = AssetConfig.from_ticker("USD")

CURRENCIES = [asset.as_currency() for asset in ALL_ASSETS]
CURRENCIES = [asset.as_currency() for asset in ALL_ASSETS_CONFIGS]
USD_PAIRS: List[Pair] = filter(
lambda x: x is not None,
[Pair.from_asset_configs(asset, USD_ASSET_CONFIG) for asset in ALL_ASSETS],
[Pair.from_asset_configs(asset, USD_ASSET_CONFIG) for asset in ALL_ASSETS_CONFIGS],
)

# ETH/USD, BTC/USD
Expand Down

0 comments on commit 21c5fce

Please sign in to comment.