From 15f9a9efe11dee99549343468faaddce5d26dd90 Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Thu, 9 Jan 2020 18:13:24 +0100 Subject: [PATCH] Removes triggered from to_json Triggered has been deatached from the appointment having it's own entry into the db, so not part of the appointment data anymore --- common/appointment.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/common/appointment.py b/common/appointment.py index 3b31365..7b21471 100644 --- a/common/appointment.py +++ b/common/appointment.py @@ -81,28 +81,18 @@ class Appointment: return appointment - def to_json(self, triggered=False): + def to_json(self): """ Exports an appointment as a deterministic json encoded string. This method ensures that multiple invocations with the same data yield the same value. This is the format used to store appointments in the database. - Args: - triggered (:mod:`bool`): Whether the dispute has been triggered or not. When an appointment passes from the - :mod:`Watcher ` to the :mod:`Responder ` it is not deleted straightaway. - Instead, the appointment is stored in the DB flagged as ``triggered``. This aims to ease handling block - reorgs in the future. - Returns: :obj:`str`: A json-encoded str representing the appointment. """ - appointment = self.to_dict() - - appointment["triggered"] = triggered - - return json.dumps(appointment, sort_keys=True, separators=(",", ":")) + return json.dumps(self.to_dict(), sort_keys=True, separators=(",", ":")) def serialize(self): """