From 4eb7cc5102dba638dde64cb859481578e27066de Mon Sep 17 00:00:00 2001 From: gabrielfior Date: Thu, 26 Dec 2024 15:33:12 -0300 Subject: [PATCH] Fixing Seer tests --- prediction_market_agent_tooling/markets/seer/data_models.py | 6 +++++- .../markets/seer/seer_subgraph_handler.py | 2 +- .../markets/seer/test_seer_subgraph_handler.py | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/prediction_market_agent_tooling/markets/seer/data_models.py b/prediction_market_agent_tooling/markets/seer/data_models.py index 33b830b8..fab47546 100644 --- a/prediction_market_agent_tooling/markets/seer/data_models.py +++ b/prediction_market_agent_tooling/markets/seer/data_models.py @@ -3,13 +3,17 @@ from prediction_market_agent_tooling.gtypes import HexBytes +class SeerParentMarket(BaseModel): + id: HexBytes + + class SeerMarket(BaseModel): model_config = ConfigDict(populate_by_name=True) id: HexBytes title: str = Field(alias="marketName") outcomes: list[str] - parent_market: HexBytes | None = Field(alias="parentMarket") + parent_market: SeerParentMarket | None = Field(alias="parentMarket") wrapped_tokens: list[HexBytes] = Field(alias="wrappedTokens") diff --git a/prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py b/prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py index 69845fbe..dab78800 100644 --- a/prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py +++ b/prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py @@ -47,7 +47,7 @@ def _get_fields_for_markets(self, markets_field: FieldPath) -> list[FieldPath]: markets_field.creator, markets_field.marketName, markets_field.outcomes, - markets_field.parentMarket, + markets_field.parentMarket.id, markets_field.finalizeTs, markets_field.wrappedTokens, ] diff --git a/tests_integration/markets/seer/test_seer_subgraph_handler.py b/tests_integration/markets/seer/test_seer_subgraph_handler.py index 9caa8e42..a4c30fb2 100644 --- a/tests_integration/markets/seer/test_seer_subgraph_handler.py +++ b/tests_integration/markets/seer/test_seer_subgraph_handler.py @@ -17,7 +17,6 @@ def handler() -> t.Generator[SeerSubgraphHandler, None, None]: yield SeerSubgraphHandler() -@pytest.skip(reason="Seer subgraph ") def test_get_all_seer_markets(handler: SeerSubgraphHandler) -> None: markets = handler.get_bicategorical_markets() assert len(markets) > 1