From ea4d6cf34510f2bababe456d0e0428099edf9021 Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Tue, 11 Feb 2020 21:55:02 +0100 Subject: [PATCH] Updates e2e tests to derive pk from sk intead of using load_keys Since we're creating a new set of keys in the e2e tests the hardcoded public key of the cli won't work --- test/pisa/e2e/test_basic_e2e.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/pisa/e2e/test_basic_e2e.py b/test/pisa/e2e/test_basic_e2e.py index ceec093..5e3ef73 100644 --- a/test/pisa/e2e/test_basic_e2e.py +++ b/test/pisa/e2e/test_basic_e2e.py @@ -3,6 +3,7 @@ import binascii from time import sleep from riemann.tx import Tx +from pisa import config from pisa import HOST, PORT from apps.cli import wt_cli from apps.cli.blob import Blob @@ -137,7 +138,10 @@ def test_appointment_wrong_key(bitcoin_cli, create_txs): # # signature = Cryptographer.sign(appointment.serialize(), cli_sk) # data = {"appointment": appointment.to_dict(), "signature": signature, "public_key": hex_pk_der.decode("utf-8")} - pisa_pk = wt_cli.load_keys() + # FIXME: Since the pk is now hardcoded for the alpha in the cli we cannot use load_keys here. We need to derive + # the pk from the sk on disk. + pisa_sk = Cryptographer.load_private_key_der(Cryptographer.load_key_file(config.get("PISA_SECRET_KEY"))) + pisa_pk = pisa_sk.public_key() data = {"appointment": appointment.to_dict()} # Send appointment to the server.