Add comments for multiple issues

This commit is contained in:
Sergi Delgado Segura
2019-08-09 17:28:58 +01:00
parent d5899f8909
commit 1019b207ff
4 changed files with 7 additions and 9 deletions

View File

@@ -10,7 +10,7 @@ import json
from utils.authproxy import AuthServiceProxy from utils.authproxy import AuthServiceProxy
from conf import BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT from conf import BTC_RPC_USER, BTC_RPC_PASSWD, BTC_RPC_HOST, BTC_RPC_PORT
# ToDo: #5-add-async-to-api
app = Flask(__name__) app = Flask(__name__)
HTTP_OK = 200 HTTP_OK = 200
HTTP_BAD_REQUEST = 400 HTTP_BAD_REQUEST = 400

View File

@@ -5,8 +5,8 @@ from pisa.encrypted_blob import EncryptedBlob
class Appointment: class Appointment:
def __init__(self, locator, start_time, end_time, dispute_delta, encrypted_blob, cipher, hash_function): def __init__(self, locator, start_time, end_time, dispute_delta, encrypted_blob, cipher, hash_function):
self.locator = locator self.locator = locator
self.start_time = start_time self.start_time = start_time # ToDo: #4-standardize-appointment-fields
self.end_time = end_time self.end_time = end_time # ToDo: #4-standardize-appointment-fields
self.dispute_delta = dispute_delta self.dispute_delta = dispute_delta
self.encrypted_blob = EncryptedBlob(encrypted_blob) self.encrypted_blob = EncryptedBlob(encrypted_blob)
self.cipher = cipher self.cipher = cipher
@@ -19,9 +19,7 @@ class Appointment:
return appointment return appointment
# ToDO: We may want to add some additional things to the appointment, like # ToDO: #3-improve-appointment-strcuture
# minimum fee
# refund to be payed to the user in case of failing

View File

@@ -146,7 +146,7 @@ class Inspector:
return rcode, message return rcode, message
# DISCUSS: ANYTHING TO CHECK HERE? # ToDo: #5-define-checks-encrypted-blob
def check_blob(self, encrypted_blob): def check_blob(self, encrypted_blob):
message = None message = None
rcode = 0 rcode = 0
@@ -160,7 +160,7 @@ class Inspector:
rcode = errors.APPOINTMENT_WRONG_FIELD_TYPE rcode = errors.APPOINTMENT_WRONG_FIELD_TYPE
message = "wrong encrypted_blob data type ({})".format(t) message = "wrong encrypted_blob data type ({})".format(t)
elif encrypted_blob == '': elif encrypted_blob == '':
# ToDo: We may want to define this to be at least as long as one block of the cipher we are using # ToDo: #5 We may want to define this to be at least as long as one block of the cipher we are using
rcode = errors.APPOINTMENT_WRONG_FIELD rcode = errors.APPOINTMENT_WRONG_FIELD
message = "wrong encrypted_blob" message = "wrong encrypted_blob"
if self.debug and message: if self.debug and message:

View File

@@ -2,7 +2,7 @@ import zmq
import binascii import binascii
from conf import FEED_PROTOCOL, FEED_ADDR, FEED_PORT from conf import FEED_PROTOCOL, FEED_ADDR, FEED_PORT
# ToDo: #7-add-async-back-to-zmq
class ZMQHandler: class ZMQHandler:
""" Adapted from https://github.com/bitcoin/bitcoin/blob/master/contrib/zmq/zmq_sub.py""" """ Adapted from https://github.com/bitcoin/bitcoin/blob/master/contrib/zmq/zmq_sub.py"""
def __init__(self, parent): def __init__(self, parent):