summary refs log tree commit diff
path: root/synapse/state/v1.py
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2021-10-06 18:55:25 +0100
committerGitHub <noreply@github.com>2021-10-06 17:55:25 +0000
commitf563676c097b830346acc7a4ce3e910c6b10c4c3 (patch)
tree40cdd8b11526d49bcef39d8a763f89c795c83ce7 /synapse/state/v1.py
parentAdd content to the Synapse documentation intro page (#10990) (diff)
downloadsynapse-f563676c097b830346acc7a4ce3e910c6b10c4c3.tar.xz
`disallow-untyped-defs` for `synapse.state` (#11004)
* `disallow-untyped-defs` for `synapse.state`

Much smaller than I was expecting!
Diffstat (limited to 'synapse/state/v1.py')
-rw-r--r--synapse/state/v1.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/state/v1.py b/synapse/state/v1.py
index 017e6fd92d..ffe6207a3c 100644
--- a/synapse/state/v1.py
+++ b/synapse/state/v1.py
@@ -225,7 +225,7 @@ def _resolve_with_state(
     conflicted_state_ids: StateMap[Set[str]],
     auth_event_ids: StateMap[str],
     state_map: Dict[str, EventBase],
-):
+) -> MutableStateMap[str]:
     conflicted_state = {}
     for key, event_ids in conflicted_state_ids.items():
         events = [state_map[ev_id] for ev_id in event_ids if ev_id in state_map]
@@ -362,7 +362,7 @@ def _resolve_normal_events(
 
 
 def _ordered_events(events: Iterable[EventBase]) -> List[EventBase]:
-    def key_func(e):
+    def key_func(e: EventBase) -> Tuple[int, str]:
         # we have to use utf-8 rather than ascii here because it turns out we allow
         # people to send us events with non-ascii event IDs :/
         return -int(e.depth), hashlib.sha1(e.event_id.encode("utf-8")).hexdigest()