bitcoin_cli as a global variable in the main __init__.py was creating issues related to http.client.CannotSendRequest: Request-sent and connection re-usage. Define a new connection per request.
The decryption for the `EncryptedBlob` using AES-GCM-128 (the only cipher available atm) raises an `InvalidTag` exception. This was not properly captured by the watcher making it crash. This behavior was already discovered during the `EncryptedBlob` unit testing and left to be fixed in the `Watcher` unit testing.
However, making the EncryptedBlob raise such an exception may not be a good practice, since other ciphers may run into different exceptions. Therefore, the `EncryptedBlob` has been modified to return None upon facing a decryption issue, the `BlockProcessor` will detect that and return a None justice_txm and justice_txid. Upon receiving a None `justice_txid` the `Watcher` will delete the appointment without notifiying the `Responder`.
- Adds unit tests for API
- Updates API to let BlockProcessor deal with block block related JSON-RPC
- Fixes BlockProcessor get_potential_matches return
- Makes bitcoin_sim runnable via function (instead of a main runnable script) to work with pytests fixture
- <3 Fixture
The input types for Blob.encrypt and EncryptedBlob.decrypt were not consistent. The former was in hex whereas the later was in bytes. Format the later in hex for consistency.