Sergi Delgado Segura
71ce7c46ec
Removes the parameters for do_subscribe + PEP8
2019-10-21 16:54:48 +01:00
Sergi Delgado Segura
e5013d5bca
Dissables Flask logging
2019-10-21 16:53:29 +01:00
Sergi Delgado Segura
d1d9693435
Adds coverage exclusions
2019-10-17 19:27:43 +01:00
Sergi Delgado Segura
c09becd7fa
Fixes to_dict/to_json for and some fixes
2019-10-17 19:11:32 +01:00
Sergi Delgado Segura
6735aac094
Update tests to use bitcoind_sim event-wise
...
Also clean son unused imports
2019-10-17 19:08:34 +01:00
Sergi Delgado Segura
1643a7b887
Multiple simulator improvements
...
The simulator has been updated to work with real transaction structures instead of transaction hashes. It now supports:
- Non-SegWit transaction format
- Generation of blocks event-wise and time-wise
Some small issues have also been fixed.
With the new approach, the simulator can be used in a broader range of tests. Moreover tests can run faster since they do not have to wait for blocks. Instead, the generation of new blocks can be triggered by the test.
2019-10-17 19:00:15 +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
3e62cb4b70
Parametrize start and end appointment offsets
...
Also waits an additional for transactions to be cleaned to be safe
2019-10-16 12:42:50 +01:00
Sergi Delgado Segura
b74df42a2b
Runs bitcoin-cli locally
2019-10-14 17:41:09 +01:00
Sergi Delgado Segura
50d892b197
Remove wrong parenthesis
2019-10-14 17:40:49 +01:00
Sergi Delgado Segura
409f8fb5fb
Adds Watcher unit tests
2019-10-14 16:58:31 +01:00
Sergi Delgado Segura
5f87705d26
Dissables can_connect_to_bitcoind with a non-running backend
...
Until a better way of handling the stop of bitcoind the test is dissabled, it created issues with other tests.
2019-10-14 16:57:58 +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
d43ab76220
Updates conftest fixtures so they do not autorun
...
The modules that need to run either bitcoind or the api do now reference to the fixture in the first test that needs it. Since the fixtures are definexd session-wise the rest of the modules will have access to them from that point on.
2019-10-14 13:19:54 +01:00
Sergi Delgado Segura
d35b9c13c4
Fixes responder missing_confirmation dict access
2019-10-14 13:00:49 +01:00
Sergi Delgado Segura
abe359f7d1
Fixes test to work with session fixtures
...
Test were running fine standalone but failing / having Address reuse issues when running all together. Fixing that.
2019-10-14 13:00:21 +01:00
Sergi Delgado Segura
e5ab943f8c
Adds conftest and defines session fixtures
2019-10-14 12:59:22 +01:00
Sergi Delgado Segura
6baa059431
Adds additional unit tests to tools
2019-10-11 20:54:31 +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
b78c6ebfe7
Removes debug flags from old code
2019-10-11 19:07:46 +01:00
Salvatore Ingala
ebf0a06bd6
Merge pull request #38 from sr-gi/11-graceful-shutdown
...
Add graceful shutdown
2019-10-11 16:28:00 +07:00
Salvatore Ingala
8acff789fe
Add reference to github issue for the Todo
2019-10-11 11:27:03 +07:00
Salvatore Ingala
6348319dfb
Using logging instead of print; added startup log message
2019-10-11 09:26:29 +07:00
Salvatore Ingala
99f3400d63
Added SIGTERM and SIGQUIT
2019-10-10 22:37:06 +07:00
Salvatore Ingala
9603138777
Added SIGINT signal handler
2019-10-10 22:25:20 +07: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
36434552d2
Merge pull request #33 from sr-gi/21-json-logs
...
Changed log format to JSON
2019-10-10 18:54:58 +07:00
Salvatore Ingala
8c2c893c5c
Merge branch 'testing' into 21-json-logs
2019-10-10 18:49:06 +07:00
Salvatore Ingala
d05c2c21b7
warn ==> warning
2019-10-10 18:39:54 +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
9f25ef8603
Fixes from PR review
2019-10-10 18:22:33 +07:00
Salvatore Ingala
aea1d1f1e0
Fixes from PR review
2019-10-10 11:07:58 +07:00
Salvatore Ingala
831545ef2c
Added simple tests for check_txid_format
2019-10-10 09:59:12 +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
a53e7a82e3
Added 'actor' among the fields of the structured log messages; minor other fixes
2019-10-10 09:59:10 +07:00
Salvatore Ingala
4bcc8e20a0
Refactored check_tx_in_chain with new log format
2019-10-10 09:59:10 +07:00
Salvatore Ingala
bae9b6b913
Added Logger class; refactored logging accordingly
2019-10-10 09:59:10 +07:00
Salvatore Ingala
7f9c7d8609
Removed double initialization of logging
2019-10-10 09:58:28 +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
Salvatore Ingala
1b229cb441
Added *.pyc and .cache/ to .gitignore
2019-10-10 09:57:04 +07:00
Sergi Delgado Segura
db635ef688
Add missing comment
2019-10-09 19:00:08 +01:00
Sergi Delgado Segura
8b62ff9e56
Update some comments/todos/discuss
2019-10-09 17:38:15 +01:00
Sergi Delgado Segura
1de226374d
Minot simulator updates
2019-10-09 17:34:44 +01: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
c67e41d185
Includes getbestblockhash so it can simulate db loads
2019-10-09 15:58:54 +01:00
Sergi Delgado Segura
e0d0818f6b
Removes unused code
2019-10-09 15:32:56 +01:00