mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 22:24:23 +01:00
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.
This commit is contained in:
@@ -7,7 +7,7 @@ from pisa.logger import Logger
|
||||
from pisa.api import start_api
|
||||
from pisa.watcher import Watcher
|
||||
from pisa.builder import Builder
|
||||
from pisa.conf import BTC_NETWORK
|
||||
from pisa.conf import BTC_NETWORK, PISA_SECRET_KEY
|
||||
from pisa.responder import Responder
|
||||
from pisa.db_manager import DBManager
|
||||
from pisa.block_processor import BlockProcessor
|
||||
@@ -49,7 +49,10 @@ if __name__ == "__main__":
|
||||
watcher_appointments_data = db_manager.load_watcher_appointments()
|
||||
responder_trackers_data = db_manager.load_responder_trackers()
|
||||
|
||||
watcher = Watcher(db_manager)
|
||||
with open(PISA_SECRET_KEY, "rb") as key_file:
|
||||
secret_key_der = key_file.read()
|
||||
|
||||
watcher = Watcher(db_manager, secret_key_der)
|
||||
|
||||
if len(watcher_appointments_data) == 0 and len(responder_trackers_data) == 0:
|
||||
logger.info("Fresh bootstrap")
|
||||
|
||||
Reference in New Issue
Block a user