diff --git a/pdr_backend/subgraph/subgraph_slot.py b/pdr_backend/subgraph/subgraph_slot.py index 502e3ef4d..ff3dc07b4 100644 --- a/pdr_backend/subgraph/subgraph_slot.py +++ b/pdr_backend/subgraph/subgraph_slot.py @@ -4,6 +4,7 @@ from enforce_typing import enforce_types from pdr_backend.subgraph.core_subgraph import query_subgraph +from pdr_backend.lake.slot import Slot from pdr_backend.util.networkutil import get_subgraph_url from pdr_backend.util.time_types import UnixTimeS @@ -122,7 +123,7 @@ def get_slots( # by passing the dict as keyword arguments # convert roundSumStakesUp and roundSumStakes to float new_slots = [ - PredictSlot( + Slot( **{ "ID": slot["id"], "timestamp": slot["slot"], diff --git a/pdr_backend/subgraph/test/test_subgraph_slot.py b/pdr_backend/subgraph/test/test_subgraph_slot.py index 6a3b6f059..9e9425ce6 100644 --- a/pdr_backend/subgraph/test/test_subgraph_slot.py +++ b/pdr_backend/subgraph/test/test_subgraph_slot.py @@ -4,11 +4,11 @@ from enforce_typing import enforce_types from pdr_backend.subgraph.subgraph_slot import ( - PredictSlot, fetch_slots, get_predict_slots_query, get_slots, ) +from pdr_backend.lake.slot import Slot from pdr_backend.util.time_types import UnixTimeS @@ -31,7 +31,7 @@ def test_get_predict_slots_query(): # Sample data for tests SAMPLE_PREDICT_QUERY_RESULT_ITEM = { "id": "0xAsset-12345", - "slot": "12345", + "slot": 12345, "trueValues": [{"ID": "1", "trueValue": True}], "roundSumStakesUp": 150.0, "roundSumStakes": 100.0, @@ -78,8 +78,8 @@ def test_get_slots(mock_query_subgraph): assert mock_query_subgraph.call_count == 1 # Verify that the result contains the expected number of slots assert len(result_slots) == 1000 - # Verify that the slots contain instances of PredictSlot - assert isinstance(result_slots[0], PredictSlot) + # Verify that the slots contain instances of Slot + assert isinstance(result_slots[0], Slot) # Verify the first slot's data matches the sample assert result_slots[0].ID == "0xAsset-12345"