use the right function for when we're already in runInteraction

This commit is contained in:
Hubert Chathi 2019-10-18 10:56:54 +01:00
parent 8e86f5b65c
commit f0f6a2b360

View file

@ -346,7 +346,8 @@ class EndToEndKeyStore(EndToEndKeyWorkerStore, SQLBaseStore):
# The "keys" property must only have one entry, which will be the public
# key, so we just grab the first value in there
pubkey = next(iter(key["keys"].values()))
self._simple_insert(
self._simple_insert_txn(
txn,
"devices",
values={
"user_id": user_id,
@ -354,12 +355,12 @@ class EndToEndKeyStore(EndToEndKeyWorkerStore, SQLBaseStore):
"display_name": key_type + " signing key",
"hidden": True,
},
desc="store_master_key_device",
)
# and finally, store the key itself
with self._cross_signing_id_gen.get_next() as stream_id:
self._simple_insert(
self._simple_insert_txn(
txn,
"e2e_cross_signing_keys",
values={
"user_id": user_id,
@ -367,7 +368,6 @@ class EndToEndKeyStore(EndToEndKeyWorkerStore, SQLBaseStore):
"keydata": json.dumps(key),
"stream_id": stream_id,
},
desc="store_master_key",
)
def set_e2e_cross_signing_key(self, user_id, key_type, key):