summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-10-28 12:29:55 +0000
committerAmber Brown <hawkowl@atleastfornow.net>2019-10-28 14:29:55 +0200
commit9aee28927b22a16ea0699c3f73fbc58121511630 (patch)
treec5d52c214a89e3ca1cc4dae725b23415cc3ef7f9 /synapse/storage
parentMerge pull request #6253 from matrix-org/uhoreg/e2e_backup_delete_keys (diff)
downloadsynapse-9aee28927b22a16ea0699c3f73fbc58121511630.tar.xz
Convert EventContext to attrs (#6218)
* make EventContext use an attr
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/data_stores/main/state.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/storage/data_stores/main/state.py b/synapse/storage/data_stores/main/state.py
index d54442e5fa..9b2207075b 100644
--- a/synapse/storage/data_stores/main/state.py
+++ b/synapse/storage/data_stores/main/state.py
@@ -15,6 +15,7 @@
 
 import logging
 from collections import namedtuple
+from typing import Iterable, Tuple
 
 from six import iteritems, itervalues
 from six.moves import range
@@ -23,6 +24,8 @@ from twisted.internet import defer
 
 from synapse.api.constants import EventTypes
 from synapse.api.errors import NotFoundError
+from synapse.events import EventBase
+from synapse.events.snapshot import EventContext
 from synapse.storage._base import SQLBaseStore
 from synapse.storage.background_updates import BackgroundUpdateStore
 from synapse.storage.data_stores.main.events_worker import EventsWorkerStore
@@ -1215,7 +1218,9 @@ class StateStore(StateGroupWorkerStore, StateBackgroundUpdateStore):
     def __init__(self, db_conn, hs):
         super(StateStore, self).__init__(db_conn, hs)
 
-    def _store_event_state_mappings_txn(self, txn, events_and_contexts):
+    def _store_event_state_mappings_txn(
+        self, txn, events_and_contexts: Iterable[Tuple[EventBase, EventContext]]
+    ):
         state_groups = {}
         for event, context in events_and_contexts:
             if event.internal_metadata.is_outlier():