mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-02-01 12:44:25 +01:00
Integrates encryption/decryption within the Cryptographer. Close #63
Includes unittests. Also reformats test_inspector to avoid using cli functions
This commit is contained in:
@@ -39,8 +39,3 @@ def in_correct_network(network):
|
||||
correct_network = True
|
||||
|
||||
return correct_network
|
||||
|
||||
|
||||
def check_txid_format(txid):
|
||||
# TODO: #12-check-txid-regexp
|
||||
return isinstance(txid, str) and re.search(r"^[0-9A-Fa-f]{64}$", txid) is not None
|
||||
|
||||
@@ -180,7 +180,12 @@ class Watcher:
|
||||
for locator, dispute_txid in matches.items():
|
||||
for uuid in self.locator_uuid_map[locator]:
|
||||
|
||||
justice_rawtx = Cryptographer.decrypt(self.appointments[uuid].encrypted_blob, dispute_txid)
|
||||
try:
|
||||
justice_rawtx = Cryptographer.decrypt(self.appointments[uuid].encrypted_blob, dispute_txid)
|
||||
|
||||
except ValueError:
|
||||
justice_rawtx = None
|
||||
|
||||
justice_tx = BlockProcessor.decode_raw_transaction(justice_rawtx)
|
||||
|
||||
if justice_tx is not None:
|
||||
|
||||
Reference in New Issue
Block a user