Commit Graph

795 Commits

Author SHA1 Message Date
Sergi Delgado Segura
1d1efc9ccf Adds some missing Responder unit tests
Excluding the basic reorgs hangle, we need a better bitcoind mock or a different testing approach to reach a higher code coverage. This is as far as it can get for the Responder at the moment
2019-11-14 15:05:45 +00:00
Sergi Delgado Segura
ca3f6ee1b1 Fixes memory leak bug regarding test db 2019-11-14 15:04:55 +00:00
Sergi Delgado Segura
f65e2af675 Deletes missed print 2019-11-14 15:03:03 +00:00
Sergi Delgado Segura
c54d10f92c Fixes Responder
There were a couple of wrong things going on in the `Responder`:

- `check_confirmations` included in 8a10979db0 was not doing a good job keeping track of the missed confirmations, probably due to a overlooked refactor.

- There was an edge case when adding txs to `unconfirmed_txs` on `create_job` that may lead to a transaction being confirmed and unconfirmed at the same time from the `Responder's` pow. It could be triggered by adding two jobs with the same justice_txid.
2019-11-11 17:50:28 +00:00
Sergi Delgado Segura
f81cb04b74 Fixes get_distance_to_tip 2019-11-11 14:03:18 +00:00
Sergi Delgado Segura
fb7dfd4df8 Add missing Cleaner unit tests 2019-11-11 13:28:24 +00:00
Sergi Delgado Segura
3c6f13ef00 Rename delete_completed_appointments and rearange arguments 2019-11-11 13:27:57 +00:00
Sergi Delgado Segura
a1a1206e0c Adds new Watcher unit tests 2019-11-08 18:25:14 +00:00
Sergi Delgado Segura
61a36048de Removes redundant tests 2019-11-08 18:24:33 +00:00
Sergi Delgado Segura
4233c9d5cc Refactor get_matches and filter_valid_matches to not be static 2019-11-08 18:21:42 +00:00
Sergi Delgado Segura
e65b02c473 Adds Cryptographer unit tests 2019-11-08 18:20:25 +00:00
Sergi Delgado Segura
da61ea9b8e Makes sure that blobs to be decrypred are even-length 2019-11-08 18:20:05 +00:00
Sergi Delgado Segura
8a10979db0 Refactors Responder and BlockProcessor
Brings check_confirmations back to the Responder
2019-11-08 16:25:40 +00:00
Sergi Delgado Segura
20faa04c4c Refactord Watcher and BlockProcessor. Closes #36.
Brings back check_potential_matches and check_matches to the Watcher.

The methods have now been renamed to check_matches (old check_potential_matches) and filter_valid_matches (old check_matches) to provide a better description of their purpose.

decode_raw_transaction has been added to BlockProcessor
2019-11-08 16:25:35 +00:00
Sergi Delgado Segura
c08013abd0 Creates Cryptographer. Separates decryptiomn from encrypted_blob 2019-11-08 16:24:31 +00:00
Sergi Delgado Segura
f4f77fb39a Improves test appointment and add missing tests 2019-11-07 19:16:39 +00:00
Sergi Delgado Segura
c384bc78c2 Changes code to use bitcoin_cli from pisa/tools 2019-11-07 19:16:18 +00:00
Sergi Delgado Segura
eb0417858e Adds missing test for EncryptedBlob 2019-11-07 19:16:18 +00:00
Sergi Delgado Segura
8b2f0efa2f Moves appointment deletion + db update to the cleaner 2019-11-07 19:16:05 +00:00
Sergi Delgado Segura
82f9de1717 Adds missing Watcher test 2019-11-07 16:56:31 +00:00
Sergi Delgado Segura
2b1640ea86 Simplifies Inspector using Appointment.from_json() constructor 2019-11-07 16:56:30 +00:00
Sergi Delgado Segura
8f7505c17a Improves generate_dummy_appointment 2019-11-07 16:56:15 +00:00
Sergi Delgado Segura
1eb4423e58 Updates gitignore 2019-11-07 15:56:49 +00:00
Sergi Delgado Segura
20f296c9d4 Reformats code to match code guidelines 2019-11-07 15:47:35 +00:00
Sergi Delgado Segura
b16775a4aa Updates style guidelines 2019-11-07 15:08:06 +00:00
Sergi Delgado Segura
8174ec61af Generalizes get_dummy_appointment (there were multiple instances of it in different tests)
Also refactors some unused imports and modifies the watcher tests to use .serialize instead of to_json
2019-11-07 15:08:06 +00:00
Sergi Delgado Segura
e6e577c99e Updates Watcher to use serialize instead of to_json 2019-11-07 15:08:05 +00:00
Sergi Delgado Segura
30159399f0 Adds serialize method
After adding the triggered flag we can not just use to_json to serialize since the two data blobs won't match. This also sets ground towards having a generalized serialization function.
2019-11-07 15:08:05 +00:00
Sergi Delgado Segura
99bda73eff Applies fixes after PR review 2019-11-07 15:07:58 +00:00
Salvatore Ingala
00a27b68e6 Various fixes from PR review 2019-11-07 15:04:21 +00:00
Salvatore Ingala
c786e3d225 Refactored add_appointment and get_appointment to avoid block nesting 2019-11-07 15:04:21 +00:00
Salvatore Ingala
24a451c108 Avoiding long strings by using random dummy txids; code formatting 2019-11-07 15:04:21 +00:00
Salvatore Ingala
21db172727 Refactored pisa_cli to improve testability; added test with wrong signature returned 2019-11-07 15:04:21 +00:00
Salvatore Ingala
956d7091eb Initial tests for pisa-cli 2019-11-07 15:04:21 +00:00
Sergi Delgado Segura
76059d569e Adds db section to sample_conf 2019-11-06 17:34:18 +00:00
Sergi Delgado Segura
31afb1373a Integrates the locator map dumping to the Watcher and Cleaner 2019-11-06 17:08:42 +00:00
Sergi Delgado Segura
810f6ec525 Adds methods to store the locator map in the db
In order to use the db for system monitoring we need a way of mapping the locator the the uuids the appointments/jobs are identified in the db. First steps towards #15
2019-11-06 17:08:05 +00:00
Sergi Delgado Segura
6a476751fa Updates omitted files 2019-11-05 19:20:08 +00:00
Sergi Delgado Segura
6cb6aecc8c Uses dummy functions from conftest and extends with Appointment.triggered flag 2019-11-05 19:13:47 +00:00
Sergi Delgado Segura
4bdadc1836 Loads only non-triggered appointments for the watcher 2019-11-05 19:13:16 +00:00
Sergi Delgado Segura
01c9f8f16c Adds triggered flag to appointment 2019-11-05 19:12:33 +00:00
Sergi Delgado Segura
a6b1f96aaf Adds dummy appointment and job methods to conftest and includes triggered param to test_api 2019-11-05 19:11:58 +00:00
Sergi Delgado Segura
6644ad5bd1 Random whitespaces removed 2019-11-02 21:18:39 -07:00
Sergi Delgado Segura
2bfee7bbcc Fixes simulator forks 2019-11-02 21:18:24 -07:00
Sergi Delgado Segura
fc1b8aa13c Adds Builder unit test 2019-11-02 21:17:50 -07:00
Sergi Delgado Segura
65bead3ef7 Uses bitcoin-cli instead of the api for getblockcount 2019-11-02 21:17:35 -07:00
Sergi Delgado Segura
276c0ae0b3 Fixes Appointment.from_dict() 2019-11-02 21:16:19 -07:00
Sergi Delgado Segura
ddb3f26d88 Improves build from data persistance
Fetches the missed block data to the watcher and responder queues so they can recover
2019-10-30 12:24:02 -07:00
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
e95961ae6a Adds a method to initialize queues from missed blocks 2019-10-30 12:22:13 -07:00