summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-11-27 12:10:41 +0000
committerBrendan Abolivier <babolivier@matrix.org>2019-02-13 20:54:34 +0000
commit1167fe1ad46f39d7aaf58ee1f5f0d6c434303523 (patch)
tree1ce285ff3c753db5e4b1ed82aa58fa3278966e77
parentMake room ID smaller (diff)
downloadsynapse-1167fe1ad46f39d7aaf58ee1f5f0d6c434303523.tar.xz
Drop unnecessary keys from transactions
-rw-r--r--synapse/federation/units.py16
1 files changed, 3 insertions, 13 deletions
diff --git a/synapse/federation/units.py b/synapse/federation/units.py
index bfd07e6615..6b329f26b4 100644
--- a/synapse/federation/units.py
+++ b/synapse/federation/units.py
@@ -77,14 +77,13 @@ class Transaction(JsonEncodedObject):
 
     internal_keys = [
         "transaction_id",
+        "origin",
         "destination",
+        "origin_server_ts",
+        "previous_ids",
     ]
 
     required_keys = [
-        "transaction_id",
-        "origin",
-        "destination",
-        "origin_server_ts",
         "pdus",
     ]
 
@@ -108,15 +107,6 @@ class Transaction(JsonEncodedObject):
         """ Used to create a new transaction. Will auto fill out
         transaction_id and origin_server_ts keys.
         """
-        if "origin_server_ts" not in kwargs:
-            raise KeyError(
-                "Require 'origin_server_ts' to construct a Transaction"
-            )
-        if "transaction_id" not in kwargs:
-            raise KeyError(
-                "Require 'transaction_id' to construct a Transaction"
-            )
-
         kwargs["pdus"] = [
             _mangle_pdu(p.get_pdu_json())
             for p in pdus