Commit Graph

337 Commits

Author SHA1 Message Date
Sergi Delgado Segura
c17c3af32a DBManager docstrings 2019-12-10 20:10:22 +01:00
Sergi Delgado Segura
2cdd78b8e6 Simplifies the Cleaner and adds docstrings
We were passing some unnecessary parameters to the Cleaner (locator) that could be derived from other data (uuid and appointments). Also standarises the order of the  parameters to match the rest of the methods
2019-12-10 13:31:42 +01:00
Sergi Delgado Segura
b0bf653ba4 Carrier docstrings 2019-12-10 12:28:01 +01:00
Sergi Delgado Segura
f287bdf073 Fixes returns 2019-12-10 12:02:25 +01:00
Sergi Delgado Segura
899b60c083 Adds Builder docstrings 2019-12-10 11:33:01 +01:00
Sergi Delgado Segura
a6a38ff33c BlockProcessor docstrings 2019-12-10 11:10:10 +01:00
Sergi Delgado Segura
6e196b25bd Capitalization of returns first char 2019-12-10 10:44:52 +01:00
Sergi Delgado Segura
05dad7d38b Further improvements, including references 2019-12-09 20:08:05 +01:00
Sergi Delgado Segura
6a5a23a1d6 Fixes format for line breaks 2019-12-09 19:23:57 +01:00
Sergi Delgado Segura
a8f4bfc1ee Updates gitignore 2019-12-09 19:23:38 +01:00
Sergi Delgado Segura
add5d262b6 Includes Appointment docstrings and redesigns triggered flag
The triggered flag is only used to interact with the DB but it was kept as an Appointment attribute. Now it is only used when exporting to json, which is used to store data into the db.
2019-12-09 14:36:16 +01:00
Sergi Delgado Segura
641cc3be4f api docstrings 2019-12-09 14:33:31 +01:00
Sergi Delgado Segura
dac9f56901 Gets rid of Appointment.serialize()
The method is replaced by signature_foramt in Cryptographer
2019-12-09 13:31:06 +01:00
Sergi Delgado Segura
589d24c472 Removes old TODO.md file 2019-12-09 10:17:30 +01:00
Sergi Delgado Segura
d39056a0cc Refactors signing/verifiying functionality to be part of the Cryptographer
- All encryption/decryption and signing/verifying calls are performed by the cryptographer now.

- The current signature format is temporal. We should define something not base on json.

- Some Cryptographer tests are still missing.

- The cli tests should be modified to fit this too.
2019-12-07 13:22:39 +01:00
Sergi Delgado Segura
ae676e6632 Changes key encoding format from PEM to DER 2019-12-07 13:22:13 +01:00
Sergi Delgado Segura
a8800ac375 Integrates encryption/decryption within the Cryptographer. Close #63
Includes unittests. Also reformats test_inspector to avoid using cli functions
2019-12-06 13:23:02 +01:00
Sergi Delgado Segura
3c95c31bc8 Creates tools shared between client and server side
Includes check_txid_format that has been renamed. Close #12 #43
2019-12-06 13:20:58 +01:00
Sergi Delgado Segura
5f7cd7e189 Delete old TODOs 2019-12-05 11:34:44 +01:00
Sergi Delgado Segura
b4197aa5bb Replaces hardcoded 16/32 for LOCATOR lengths 2019-12-05 11:26:58 +01:00
Sergi Delgado Segura
bd08b151df Replaces locator with common/constants value 2019-12-05 11:03:36 +01:00
Sergi Delgado Segura
ac912aea69 Removes unused errors, redefines the ones after those 2019-12-05 11:02:46 +01:00
Sergi Delgado Segura
babb746dbd Create common package
Moves cryptographer to common. Also adds constants and defines the leghtn of the locator to avoid hardcoding it in almost every file
2019-12-05 11:02:17 +01:00
Sergi Delgado Segura
f0150ce585 Removes hash/cipher configuration and changes AESGCM128 for CHACHA20POLY1305
Updates tests accordingly
2019-12-04 17:46:07 +01:00
Sergi Delgado Segura
c679d59451 Merge branch '59-uncovered-tests' 2019-12-04 14:41:24 +01:00
Sergi Delgado Segura
5e9211d562 Some parameters were mixed up when boostraping from DB 2019-12-04 13:27:29 +01:00
Sergi Delgado Segura
c663fab788 Return non found if the locator does not fit the proper format 2019-12-04 13:27:06 +01:00
orbitalturtle
f6e3fadaae Merge pull request #60 from orbitalturtle/client-appointment-sign
Client appointment sign
2019-11-28 09:07:20 -05:00
Turtle
98b3dcae7b Test that server validates signature properly 2019-11-28 09:04:43 -05:00
Turtle
7713a3cd47 Server validates appointment signature upon reception 2019-11-26 23:21:07 -05:00
Turtle
79d986677d Client signs appointment before sending it to server 2019-11-26 23:21:00 -05:00
Sergi Delgado Segura
d2b7216a96 Addresses requested changes 2019-11-22 14:48:38 +00: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
3dad5b7c71 Adds tests for check_tx_in_chain 2019-11-20 13:01:56 +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
f91413ebd8 Properly handles mempool checks
Transactions were included in the mempool as rawtxs but checked as txids, so effectively every time we checked if a transaction was in mempool it returned false
2019-11-20 12:59:29 +00:00
Sergi Delgado Segura
287dfeeee3 Adds missing test on BlockProessor 2019-11-18 16:39:50 +00:00
Sergi Delgado Segura
764e513ab9 Replaces asserts for Exceptions in simulator 2019-11-18 16:39:23 +00:00
Sergi Delgado Segura
a1c0eeadbc Add missing EncryptedBlob tests 2019-11-18 15:25:15 +00:00
Sergi Delgado Segura
6ff580ed8f Updates test_api according to 1b78060 and add missing cases 2019-11-14 17:38:26 +00:00
Sergi Delgado Segura
3a1bf0cc8a Updates API to use DB on get methods 2019-11-14 17:38:26 +00:00
Sergi Delgado Segura
f33d2d61ac Moves start api to test_api since it was the only place where it's used 2019-11-14 17:38:19 +00:00
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