diff options
author | Erik Johnston <erik@matrix.org> | 2018-11-27 12:10:41 +0000 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2019-02-13 15:16:03 +0000 |
commit | 9dfb6b6c5290d9066a25fcc61c83bed7aa8e8fb5 (patch) | |
tree | e6930c7590049cadc88c3f25e85bbe48008e8a05 | |
parent | Track PDU in opentracing (diff) | |
download | synapse-9dfb6b6c5290d9066a25fcc61c83bed7aa8e8fb5.tar.xz |
Drop unnecessary keys from transactions
-rw-r--r-- | synapse/federation/units.py | 16 |
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 |