Skip to content
Snippets Groups Projects
Unverified Commit 50ae4eaf authored by Dirk Klimpel's avatar Dirk Klimpel Committed by GitHub
Browse files

Add some type hints to `event_federation` datastore (#12753)

parent 682431ef
No related branches found
No related tags found
No related merge requests found
Add some type hints to datastore.
\ No newline at end of file
...@@ -27,7 +27,6 @@ exclude = (?x) ...@@ -27,7 +27,6 @@ exclude = (?x)
|synapse/storage/databases/__init__.py |synapse/storage/databases/__init__.py
|synapse/storage/databases/main/cache.py |synapse/storage/databases/main/cache.py
|synapse/storage/databases/main/devices.py |synapse/storage/databases/main/devices.py
|synapse/storage/databases/main/event_federation.py
|synapse/storage/schema/ |synapse/storage/schema/
|tests/api/test_auth.py |tests/api/test_auth.py
......
...@@ -53,6 +53,7 @@ class RoomBatchHandler: ...@@ -53,6 +53,7 @@ class RoomBatchHandler:
# We want to use the successor event depth so they appear after `prev_event` because # We want to use the successor event depth so they appear after `prev_event` because
# it has a larger `depth` but before the successor event because the `stream_ordering` # it has a larger `depth` but before the successor event because the `stream_ordering`
# is negative before the successor event. # is negative before the successor event.
assert most_recent_prev_event_id is not None
successor_event_ids = await self.store.get_successor_events( successor_event_ids = await self.store.get_successor_events(
most_recent_prev_event_id most_recent_prev_event_id
) )
...@@ -139,6 +140,7 @@ class RoomBatchHandler: ...@@ -139,6 +140,7 @@ class RoomBatchHandler:
_, _,
) = await self.store.get_max_depth_of(event_ids) ) = await self.store.get_max_depth_of(event_ids)
# mapping from (type, state_key) -> state_event_id # mapping from (type, state_key) -> state_event_id
assert most_recent_event_id is not None
prev_state_map = await self.state_store.get_state_ids_for_event( prev_state_map = await self.state_store.get_state_ids_for_event(
most_recent_event_id most_recent_event_id
) )
......
This diff is collapsed.
...@@ -332,6 +332,7 @@ class FederationTestCase(unittest.FederatingHomeserverTestCase): ...@@ -332,6 +332,7 @@ class FederationTestCase(unittest.FederatingHomeserverTestCase):
most_recent_prev_event_depth, most_recent_prev_event_depth,
) = self.get_success(self.store.get_max_depth_of(prev_event_ids)) ) = self.get_success(self.store.get_max_depth_of(prev_event_ids))
# mapping from (type, state_key) -> state_event_id # mapping from (type, state_key) -> state_event_id
assert most_recent_prev_event_id is not None
prev_state_map = self.get_success( prev_state_map = self.get_success(
self.state_store.get_state_ids_for_event(most_recent_prev_event_id) self.state_store.get_state_ids_for_event(most_recent_prev_event_id)
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment