Fixes tests

This commit is contained in:
Sergi Delgado Segura
2020-04-10 16:31:10 +02:00
parent a1a87ba9da
commit 5c35ff1249
3 changed files with 54 additions and 64 deletions

View File

@@ -33,7 +33,7 @@ teos_get_all_appointments_endpoint = "{}/get_all_appointments".format(teos_base_
teosd_process = run_teosd()
teos_pk, cli_sk, compressed_cli_pk = teos_cli.load_keys(
cli_config.get("TEOS_PUBLIC_KEY"), cli_config.get("CLI_PRIVATE_KEY"), cli_config.get("CLI_PUBLIC_KEY")
cli_config.get("TEOS_PUBLIC_KEY"), cli_config.get("CLI_PRIVATE_KEY")
)
@@ -238,7 +238,7 @@ def test_appointment_wrong_decryption_key(bitcoin_cli):
# The appointment data is built using a random 32-byte value.
appointment_data = build_appointment_data(bitcoin_cli, get_random_value_hex(32), penalty_tx)
# We can't use teos_cli.add_appointment here since it computes the locator internally, so let's do it manually.
# We cannot use teos_cli.add_appointment here since it computes the locator internally, so let's do it manually.
# We will encrypt the blob using the random value and derive the locator from the commitment tx.
appointment_data["locator"] = compute_locator(bitcoin_cli.decoderawtransaction(commitment_tx).get("txid"))
appointment_data["encrypted_blob"] = Cryptographer.encrypt(penalty_tx, get_random_value_hex(32))

View File

@@ -14,6 +14,7 @@ from test.teos.unit.conftest import (
bitcoin_cli,
get_config,
bitcoind_connect_params,
generate_keypair,
)
config = get_config()
@@ -99,7 +100,7 @@ def test_update_states_empty_list(db_manager, carrier, block_processor):
db_manager=db_manager,
block_processor=block_processor,
responder=Responder(db_manager, carrier, block_processor),
sk_der=None,
sk_der=generate_keypair()[0].to_der(),
max_appointments=config.get("MAX_APPOINTMENTS"),
expiry_delta=config.get("EXPIRY_DELTA"),
)
@@ -120,7 +121,7 @@ def test_update_states_responder_misses_more(run_bitcoind, db_manager, carrier,
db_manager=db_manager,
block_processor=block_processor,
responder=Responder(db_manager, carrier, block_processor),
sk_der=None,
sk_der=generate_keypair()[0].to_der(),
max_appointments=config.get("MAX_APPOINTMENTS"),
expiry_delta=config.get("EXPIRY_DELTA"),
)
@@ -145,7 +146,7 @@ def test_update_states_watcher_misses_more(db_manager, carrier, block_processor)
db_manager=db_manager,
block_processor=block_processor,
responder=Responder(db_manager, carrier, block_processor),
sk_der=None,
sk_der=generate_keypair()[0].to_der(),
max_appointments=config.get("MAX_APPOINTMENTS"),
expiry_delta=config.get("EXPIRY_DELTA"),
)