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 15:16:03 +0000
commit9dfb6b6c5290d9066a25fcc61c83bed7aa8e8fb5 (patch)
treee6930c7590049cadc88c3f25e85bbe48008e8a05
parentTrack PDU in opentracing (diff)
downloadsynapse-9dfb6b6c5290d9066a25fcc61c83bed7aa8e8fb5.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