Integrates encryption/decryption within the Cryptographer. Close #63

Includes unittests. Also reformats test_inspector to avoid using cli functions
This commit is contained in:
Sergi Delgado Segura
2019-12-06 13:22:14 +01:00
parent 3c95c31bc8
commit a8800ac375
11 changed files with 228 additions and 139 deletions

View File

@@ -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: