Commit Graph

580 Commits

Author SHA1 Message Date
Sergi Delgado Segura
ef92e2bf6f Removes bitcoind_mock from the codebase
It can be now found at https://github.com/sr-gi/bitcoind_mock/
2019-12-22 10:29:28 +01:00
Sergi Delgado Segura
1210061fb3 Merge pull request #78 from sr-gi/verbose-test
Enables stdout for unit tests
2019-12-17 17:24:33 +01:00
Sergi Delgado Segura
fffcb39124 Enables stdout for unit tests
By default pytests does not capture stdout, but it can do with -s. It is nice to have the option to verbose the tests if needed
2019-12-17 17:22:40 +01:00
Sergi Delgado Segura
d4e7e999e1 Sets sim verbose to False for unit tests 2019-12-17 17:21:48 +01:00
Sergi Delgado Segura
b82065120c Adds verbose flag to show/hide block generation on stdout 2019-12-17 17:21:21 +01:00
Sergi Delgado Segura
31fac8de7e Merge pull request #76 from sr-gi/14-passing-params-api
Refactors the API to run using dispatch instead of decorate
2019-12-17 17:10:03 +01:00
Sergi Delgado Segura
531523c534 Refactors the API to run using dispatch instead of decorate
The API was never made an object since I couldn't find a way or working around the Flask decorators.

By using dispatch we can get around the issues in #14 and will be able to create better mocks for the API
2019-12-17 17:04:57 +01:00
Sergi Delgado Segura
6129ae9b25 Merge pull request #75 from sr-gi/68-appointment-encoding
Defines a proper appointment encoding
2019-12-17 16:28:25 +01:00
Sergi Delgado Segura
680de0b7ac Update unit tests to use serialize 2019-12-17 16:22:23 +01:00
Sergi Delgado Segura
5c585a7a02 Refactors code to use appointment from common based on f4a1e34e2f4d75226c7e313b83ff5ae06c8c89ca 2019-12-17 16:22:23 +01:00
Sergi Delgado Segura
a69f1ba28b Moves appointment to common and creates serialize
Appointment serialization used to be part of the cryptographer (signature_format) but it makes more sense to be an appointment method. Therefore cli also need Appointment

Also fixes comments based on reviews
2019-12-17 16:21:54 +01:00
Sergi Delgado Segura
5c01bec89c Merge pull request #73 from sr-gi/fix-encoding
Removes unnecessary encoding when unhexlifying
2019-12-17 11:37:55 +01:00
Sergi Delgado Segura
46a7fa824f Removes unnecessary encoding when unhexlifying
binascii.unhexlify(x) is equal to binascii.unhexlify(x.encode())
2019-12-17 11:35:28 +01:00
Sergi Delgado Segura
af4544b2c0 Merge pull request #72 from sr-gi/logger
Moves Logger to common and improves logs
2019-12-17 10:04:44 +01:00
Sergi Delgado Segura
1184b4648a Fixes logs and removes redundant tailing dots 2019-12-16 19:45:30 +01:00
Sergi Delgado Segura
a9df67d787 Properly fromats console logs 2019-12-16 19:44:50 +01:00
Sergi Delgado Segura
77b191dde2 Moves Logger to common 2019-12-16 14:15:30 +01:00
Sergi Delgado Segura
74080bf104 Deletes test file 2019-12-16 13:03:17 +01:00
Sergi Delgado Segura
b363cc2d94 Adds missing tool tests 2019-12-16 12:57:28 +01:00
Sergi Delgado Segura
bc72496db9 Dissables missing logs c_logger 2019-12-16 12:50:44 +01:00
Sergi Delgado Segura
b07b6759ed Adds missing cryptographer tests 2019-12-16 12:50:24 +01:00
Sergi Delgado Segura
d37b6b6de2 Merge branch 'master' into 46-docstrings 2019-12-16 12:02:04 +01:00
Sergi Delgado Segura
399c25044a Merge branch 'simplify' 2019-12-16 11:59:05 +01:00
Sergi Delgado Segura
a7eb22626e Some fixes based on review comments 2019-12-16 11:58:14 +01:00
Sergi Delgado Segura
2575d1c469 Merge branch 'circle-ci' into 46-docstrings 2019-12-16 11:42:30 +01:00
Sergi Delgado Segura
9034e6d702 Updates circleci config to match bc250bd814
Cli tests are commented out for now
2019-12-16 11:38:25 +01:00
Sergi Delgado Segura
61663e89d7 Refactors tests folder to separate different modules
Each module has a different folder and they do not share methods now. At some point they should be split in different repos
2019-12-16 11:26:51 +01:00
Sergi Delgado Segura
bc250bd814 Gives some default values to sample_conf 2019-12-16 11:06:11 +01:00
Sergi Delgado Segura
fac0edf0c5 Remove creating keys from config 2019-12-16 11:02:17 +01:00
Sergi Delgado Segura
0574898bae Adds circule-ci config + updates requirements 2019-12-16 10:57:16 +01:00
Sergi Delgado Segura
2f67ecfa6e Changes sk_path to sk_der in Watcher
The Watcher used to receive a secret key file path ion the __init__ to load a secret key for signing. That made testing the Watcher hard, since the file needed to be present. Changing it so the main (pisad) loads the file from disk and passes the data the Watcher on init.
2019-12-16 10:54:13 +01:00
Sergi Delgado Segura
e6fd9f77cf Fixes return types for cryptographer 2019-12-16 10:25:33 +01:00
Sergi Delgado Segura
63488cb69e Fixes wrong identation in Watcher 2019-12-13 19:44:19 +01:00
Sergi Delgado Segura
83c73d5df4 Docstrings for common package 2019-12-13 18:13:29 +01:00
Sergi Delgado Segura
e2ca226b11 Last formatting details troughout the codebase 2019-12-13 18:13:29 +01:00
Sergi Delgado Segura
008a71da3a Renames matches to breaches to be consistent with the Responder. Also adds docstrings 2019-12-13 18:13:29 +01:00
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
7c1986dfc8 Renames ZMQHandler to ZMQSubscriber 2019-12-13 18:13:29 +01:00
Sergi Delgado Segura
91ca9e539f Adds Responder docstrings fixes get_txs_to_rebroadcast and renames some methods
get_txs_to_rebroadcast was beinf triggered based on received transactions indstead of stored txs. Fixing that.

Some of the names in the Responder were poorly picked (not descriptibe enough). Tries to fix that.

``Job`` class has been renames to ``TransactionTracker``.

``add_response`` has been renamed to ``handle_breach`` and ``create_job`` to ``add_tracker``.

All the variables that has `job` on it have already been updated.
2019-12-13 18:12:04 +01:00
Sergi Delgado Segura
b53627aa6d tools docstrings 2019-12-11 14:22:18 +01:00
Sergi Delgado Segura
2eafb644c3 Adds Logger docstrings 2019-12-11 14:22:09 +01:00
Sergi Delgado Segura
df5dcbdfe9 Renames dispute_delta to to_self_delay and justice tx to penalty tx
Uses the naming convention followed by LN implementations and BOLTs
2019-12-11 12:45:05 +01:00
Sergi Delgado Segura
6a7cd4d3aa Adds Inspector docstrings. Replaces dispute_delta by to_self_delay 2019-12-11 12:41:08 +01:00
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