Skip to content

Commit e690d57

Browse files
committed
existing unit test updates
1 parent a30b42b commit e690d57

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

apps/hip-3-pusher/tests/test_price_state.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def get_config():
1212
config: Config = Config.model_construct()
1313
config.stale_price_threshold_seconds = 5
1414
config.hyperliquid = HyperliquidConfig.model_construct()
15+
config.hyperliquid.market_name = "pyth"
1516
config.hyperliquid.asset_context_symbols = [SYMBOL]
1617
config.lazer = LazerConfig.model_construct()
1718
config.lazer.feed_ids = [1, 8]
@@ -44,8 +45,8 @@ def test_good_hl_price():
4445
now = time.time()
4546
price_state.hl_oracle_state.put(SYMBOL, PriceUpdate("110000.0", now - price_state.stale_price_threshold_seconds / 2.0))
4647

47-
oracle_px, _, _ = price_state.get_all_prices(DEX)
48-
assert oracle_px == {f"{DEX}:{SYMBOL}": "110000.0"}
48+
oracle_update = price_state.get_all_prices()
49+
assert oracle_update.oracle == {f"{DEX}:{SYMBOL}": "110000.0"}
4950

5051

5152
def test_fallback_lazer():
@@ -59,8 +60,8 @@ def test_fallback_lazer():
5960
price_state.lazer_state.put(1, PriceUpdate("11050000000000", now - price_state.stale_price_threshold_seconds / 2.0))
6061
price_state.lazer_state.put(8, PriceUpdate("99000000", now - price_state.stale_price_threshold_seconds / 2.0))
6162

62-
oracle_px, _, _ = price_state.get_all_prices(DEX)
63-
assert oracle_px == {f"{DEX}:{SYMBOL}": "111616.16"}
63+
oracle_update = price_state.get_all_prices()
64+
assert oracle_update.oracle == {f"{DEX}:{SYMBOL}": "111616.16"}
6465

6566

6667

@@ -79,8 +80,8 @@ def test_fallback_hermes():
7980
price_state.hermes_state.put("2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b",
8081
PriceUpdate("98000000", now - price_state.stale_price_threshold_seconds / 2.0))
8182

82-
oracle_px, _, _ = price_state.get_all_prices(DEX)
83-
assert oracle_px == {f"{DEX}:{SYMBOL}": "113265.31"}
83+
oracle_update = price_state.get_all_prices()
84+
assert oracle_update.oracle == {f"{DEX}:{SYMBOL}": "113265.31"}
8485

8586

8687
def test_all_fail():
@@ -98,5 +99,5 @@ def test_all_fail():
9899
price_state.hermes_state.put("2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b",
99100
PriceUpdate("98000000", now - price_state.stale_price_threshold_seconds - 1.0))
100101

101-
oracle_px, _, _ = price_state.get_all_prices(DEX)
102-
assert oracle_px == {}
102+
oracle_update = price_state.get_all_prices()
103+
assert oracle_update.oracle == {}

0 commit comments

Comments
 (0)