Commit Graph

21 Commits

Author SHA1 Message Date
Sergi Delgado Segura
d881706eb3 Refactors the codebase to match the new naming from 793d563b8c053136dd5f936b0ef0cd88af215b06 and 3046eae38ee3f34857c96e6b9d43e645f7d2de2d 2019-12-13 18:13:29 +01:00
Sergi Delgado Segura
b0bf653ba4 Carrier docstrings 2019-12-10 12:28:01 +01:00
Sergi Delgado Segura
2183c57f53 Updates handle_reorgs and deletes check_tx_in_chain
Updates handle_reorg to work with the current version of the Responder (the old code was outdated and broken).

`check_tx_in_chain` was only used by `handle_reorgs`, and made not much sense at this point. The method need to check if the transaction is in mempool or blockchain, so it seems to make more sense bulding on top of `get_transaction`.
2019-11-20 15:41:50 +00:00
Sergi Delgado Segura
05961f1632 Moves tx_in_chain to Carrier
Also integrates it properly so it uses self.get_transaction() instead of bitcoin_cli straightaway. Error messages have also been merged / modified
2019-11-20 13:01:27 +00:00
Sergi Delgado Segura
20f296c9d4 Reformats code to match code guidelines 2019-11-07 15:47:35 +00:00
Sergi Delgado Segura
45552e390c Changes send_transaction to not be recursive
send_transaction had an edge case that was treated recursively. Return a receipt instead and handle that in the caller
2019-10-22 15:01:50 +01: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
98c27f6013 Adds basic unit tests for the Carrier
Further testing is required for this one.
2019-10-11 19:51:50 +01:00
Sergi Delgado Segura
a916c67cc5 Fixes error logging 2019-10-11 19:32:44 +01:00
Sergi Delgado Segura
15c78072c9 Cleans comments + added method in generic exceptions
tx rejection comments moved to #37
2019-10-10 16:22:46 +01:00
Sergi Delgado Segura
6b058dfaf9 Fixes a couple of bugs from the last merge 2019-10-10 13:01:21 +01:00
Salvatore Ingala
8c2c893c5c Merge branch 'testing' into 21-json-logs 2019-10-10 18:49:06 +07:00
Sergi Delgado Segura
eb2734ccfe Improves carrier
- Takes receipt out of Carrier
- Adds missing cases (implementation missing)
- Adds notes on what to check
2019-10-10 12:34:18 +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
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
d2a07d6519 More clean up 2019-10-07 15:36:58 +01:00
Sergi Delgado Segura
9a37b211a0 Adds Carrier to take care of sending/getting transactions 2019-10-04 13:49:48 +01:00