Files
python-teos/pisa/appointment.py
Sergi Delgado Segura 93e23e769f Code clean up
Deletes debug/logging pair. Defines logging and bitcoin_cli as system-wide variables
2019-10-02 17:03:43 +01:00

26 lines
970 B
Python

from pisa.encrypted_blob import EncryptedBlob
# Basic appointment structure
class Appointment:
def __init__(self, locator, start_time, end_time, dispute_delta, encrypted_blob, cipher, hash_function):
self.locator = locator
self.start_time = start_time # ToDo: #4-standardize-appointment-fields
self.end_time = end_time # ToDo: #4-standardize-appointment-fields
self.dispute_delta = dispute_delta
self.encrypted_blob = EncryptedBlob(encrypted_blob)
self.cipher = cipher
self.hash_function = hash_function
def to_json(self):
appointment = {"locator": self.locator, "start_time": self.start_time, "end_time": self.end_time,
"dispute_delta": self.dispute_delta, "encrypted_blob": self.encrypted_blob.data,
"cipher": self.cipher, "hash_function": self.hash_function}
return appointment
# ToDO: #3-improve-appointment-structure