Commit Graph

142 Commits

Author SHA1 Message Date
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
Sergi Delgado Segura
ab72c71039 Adds appointment unit test 2019-10-09 15:19:33 +01:00
Sergi Delgado Segura
ecadbc62ef Adds _eq_ method to EncryptedBlob 2019-10-09 15:19:03 +01:00
Sergi Delgado Segura
f59c621cc0 Defines bitcoind fixture session-wise 2019-10-09 14:05:15 +01:00
Sergi Delgado Segura
e7530a53dc Fixes unconsistent test
test_get_all_appointments_responder was failing unconsistently. It was due to how the api fixture was set up.

Fix:
	- Sets up bitcoind and api fixtures to run session-wise (so they are not re-initialized for every test
	- Updates tests accordingly (e.g. reduces the number of MULTIPLE_REQUESTS so it does not cap)
	- Keeps track of all sent appointments so the test_request functionds don't need to create additional ones
2019-10-09 14:01:43 +01:00
Sergi Delgado Segura
fa5f587134 Updates tests to be pytests friedly
pytests already runs all the test_ functions, so there's no need to call them
2019-10-08 18:57:29 +01:00
Sergi Delgado Segura
9a18f759f9 Adds run_bitcoind fixture 2019-10-08 18:56:45 +01:00
Sergi Delgado Segura
e81ccd39a1 Adds API unit tests and modifies bitcoin_sim to be fixture compatible
- Adds unit tests for API
- Updates API to let BlockProcessor deal with block block related JSON-RPC
- Fixes BlockProcessor get_potential_matches return
- Makes bitcoin_sim runnable via function (instead of a main runnable script) to work with pytests fixture
- <3 Fixture
2019-10-08 18:55:27 +01:00
Sergi Delgado Segura
ab1ad33e32 Adds Blob unittests and Blob sanity checks 2019-10-07 17:22:19 +01:00
Sergi Delgado Segura
8403f871ca Adds EncryptedBlob unittests 2019-10-07 16:56:55 +01:00
Sergi Delgado Segura
10656c5955 Updates Blob Exception
Blob was raising general Exceptions when a ValueError should be a better match
2019-10-07 16:48:06 +01:00
Sergi Delgado Segura
88532f7345 Changes derypt key input type and return
The input types for Blob.encrypt and EncryptedBlob.decrypt were not consistent. The former was in hex whereas the later was in bytes. Format the later in hex for consistency.
2019-10-07 16:47:54 +01:00
Sergi Delgado Segura
76f0b1934a Client-side clean up 2019-10-07 15:59:52 +01:00
Sergi Delgado Segura
d2a07d6519 More clean up 2019-10-07 15:36:58 +01:00
Sergi Delgado Segura
4be506412e Adds Inspector unittests. Fixes some related bugs. 2019-10-07 15:19:34 +01:00
Sergi Delgado Segura
067efcca73 Clean unused imports and more cleanup 2019-10-07 11:58:28 +01:00
Sergi Delgado Segura
23efd48796 Fixes logging bug introduced in 93e23e7
When cleaning up code in commit 93e23e7 a condition was removed that makes the inspector log empty data.
2019-10-07 11:47:21 +01:00
Sergi Delgado Segura
5ae210d893 Updates os.urandom to python3
All string generated with urandom(x) were using binascii + os.urandom + encode. In python3 os.urandom has a hex method.
2019-10-07 11:39:10 +01:00
Sergi Delgado Segura
beac88a2c5 Refactors test structure 2019-10-04 17:29:13 +01:00
Sergi Delgado Segura
1e18630ce2 Adds Cleaner tests. Fixes Cleaner, Watcher and Responder
There is no need to return the dictionaries modified by the client since they are "passed-by-reference" in Python.
2019-10-04 17:23:45 +01:00
Sergi Delgado Segura
37c24dfb37 Merge branch 'cleanup' into testing 2019-10-04 15:38:28 +01:00
Sergi Delgado Segura
4704462502 Increases responder modularity
The responder had way too complex functions. Separate them into smaller / more specific ones to increse modularity and code reuse.
2019-10-04 13:52:51 +01:00
Sergi Delgado Segura
3ed9ccd466 Adds additional functionality that will be needed when deploying data persistence 2019-10-04 13:50:43 +01:00
Sergi Delgado Segura
9a37b211a0 Adds Carrier to take care of sending/getting transactions 2019-10-04 13:49:48 +01:00
Sergi Delgado Segura
3e0cca14d7 Clean up + higher modular design 2019-10-03 11:49:49 +01:00
Sergi Delgado Segura
5ba6fcb9ef Improves modularity of the code
Adds cleaner and block processor to increase the modularity and reuse of the code
2019-10-03 11:49:24 +01:00
Sergi Delgado Segura
e9832e4408 More clean up 2019-10-03 11:47:07 +01:00