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.
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.
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
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.
- 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.
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`.
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.