mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 14:14:22 +01:00
Fixes comments, docstrings and some renamings
This commit is contained in:
@@ -9,18 +9,17 @@ class Appointment:
|
||||
The :class:`Appointment` contains the information regarding an appointment between a client and the Watchtower.
|
||||
|
||||
Args:
|
||||
locator (:mod:`str`): A 16-byte hex-encoded value used by the tower to detect channel breaches. It serves as a
|
||||
locator (:obj:`str`): A 16-byte hex-encoded value used by the tower to detect channel breaches. It serves as a
|
||||
trigger for the tower to decrypt and broadcast the penalty transaction.
|
||||
start_time (:mod:`int`): The block height where the tower is hired to start watching for breaches.
|
||||
end_time (:mod:`int`): The block height where the tower will stop watching for breaches.
|
||||
to_self_delay (:mod:`int`): The ``to_self_delay`` encoded in the ``csv`` of the ``htlc`` that this appointment
|
||||
is covering.
|
||||
start_time (:obj:`int`): The block height where the tower is hired to start watching for breaches.
|
||||
end_time (:obj:`int`): The block height where the tower will stop watching for breaches.
|
||||
to_self_delay (:obj:`int`): The ``to_self_delay`` encoded in the ``csv`` of the ``to_remote`` output of the
|
||||
commitment transaction that this appointment is covering.
|
||||
encrypted_blob (:obj:`EncryptedBlob <common.encrypted_blob.EncryptedBlob>`): An ``EncryptedBlob`` object
|
||||
containing an encrypted penalty transaction. The tower will decrypt it and broadcast the penalty transaction
|
||||
upon seeing a breach on the blockchain.
|
||||
"""
|
||||
|
||||
# DISCUSS: 35-appointment-checks
|
||||
def __init__(self, locator, start_time, end_time, to_self_delay, encrypted_blob):
|
||||
self.locator = locator
|
||||
self.start_time = start_time # ToDo: #4-standardize-appointment-fields
|
||||
@@ -36,7 +35,7 @@ class Appointment:
|
||||
This method is useful to load data from a database.
|
||||
|
||||
Args:
|
||||
appointment_data (:mod:`dict`): a dictionary containing the following keys:
|
||||
appointment_data (:obj:`dict`): a dictionary containing the following keys:
|
||||
``{locator, start_time, end_time, to_self_delay, encrypted_blob}``
|
||||
|
||||
Returns:
|
||||
@@ -62,11 +61,10 @@ class Appointment:
|
||||
|
||||
def to_dict(self):
|
||||
"""
|
||||
Exports an appointment as a dictionary.
|
||||
Encodes an appointment as a dictionary.
|
||||
|
||||
Returns:
|
||||
:obj:`dict`: A dictionary containing the appointment attributes.
|
||||
|
||||
"""
|
||||
|
||||
# ToDO: #3-improve-appointment-structure
|
||||
@@ -90,7 +88,7 @@ class Appointment:
|
||||
All values are big endian.
|
||||
|
||||
Returns:
|
||||
:mod:`bytes`: The serialized data to be signed.
|
||||
:obj:`bytes`: The serialized data to be signed.
|
||||
"""
|
||||
return (
|
||||
unhexlify(self.locator)
|
||||
|
||||
Reference in New Issue
Block a user