Commit Graph

18 Commits

Author SHA1 Message Date
Sergi Delgado Segura
ccafc1999c Adds a method to get all blocks from the tip to a target 2019-10-30 12:22:57 -07:00
Sergi Delgado Segura
5bf96a10c5 Adds method to compute distance from given block to chain tip 2019-10-28 14:40:44 -07:00
Sergi Delgado Segura
3afcf9e708 Flags methods not covered by unit tests 2019-10-21 19:53:34 +01:00
Sergi Delgado Segura
95759793ba Fixes bitcoin_cli
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.
2019-10-17 17:17:52 +01:00
Sergi Delgado Segura
d7c89ddc91 Modifies behaviour towards a failed EncryptedBlob decrpytion
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`.
2019-10-14 16:57:46 +01:00
Sergi Delgado Segura
a916c67cc5 Fixes error logging 2019-10-11 19:32:44 +01:00
Salvatore Ingala
aea1d1f1e0 Fixes from PR review 2019-10-10 11:07:58 +07:00
Salvatore Ingala
dee93e5c62 Moved StructuredMessage and Logger to separate file; refactored pisa-cli logging using new format 2019-10-10 09:59:11 +07:00
Salvatore Ingala
c524319027 Several fixes and improvements 2019-10-10 09:59:11 +07:00
Salvatore Ingala
bae9b6b913 Added Logger class; refactored logging accordingly 2019-10-10 09:59:10 +07:00
Salvatore Ingala
2a5dd48950 PEP8 linting 2019-10-10 09:58:27 +07:00
Salvatore Ingala
ed0cb4f632 Changed log format to JSON; fixed missing return value in get_potential_matches 2019-10-10 09:58:27 +07:00
Sergi Delgado Segura
b69ffdc0aa Adds some BlockProcessor unit tests.
The three last methods are missing, since they seem not to belong there (check #36)
2019-10-09 17:34:32 +01:00
Sergi Delgado Segura
e81ccd39a1 Adds API unit tests and modifies bitcoin_sim to be fixture compatible
- 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
2019-10-08 18:55:27 +01:00
Sergi Delgado Segura
88532f7345 Changes derypt key input type and return
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.
2019-10-07 16:47:54 +01:00
Sergi Delgado Segura
4be506412e Adds Inspector unittests. Fixes some related bugs. 2019-10-07 15:19:34 +01:00
Sergi Delgado Segura
3ed9ccd466 Adds additional functionality that will be needed when deploying data persistence 2019-10-04 13:50:43 +01:00
Sergi Delgado Segura
5ba6fcb9ef Improves modularity of the code
Adds cleaner and block processor to increase the modularity and reuse of the code
2019-10-03 11:49:24 +01:00