diff --git a/tezt/lib_tezos/client.ml b/tezt/lib_tezos/client.ml index 41f478970cccd304fff1c63b4d134e932b6f24a9..0260f594ab2228adc46c05e80bcf86f5d5b8643f 100644 --- a/tezt/lib_tezos/client.ml +++ b/tezt/lib_tezos/client.ml @@ -599,11 +599,9 @@ let import_encrypted_secret_key ?hooks ?force ?endpoint client let* () = Lwt_io.close output_channel in Process.check process -let spawn_import_public_key ?(force = false) ?endpoint client - (public_key : Account.secret_key) ~alias = - let pk_uri = - "unencrypted:" ^ Account.require_unencrypted_secret_key ~__LOC__ public_key - in +let spawn_import_public_key ?(force = false) ?endpoint client public_key ~alias + = + let pk_uri = "unencrypted:" ^ public_key in let force = if force then ["--force"] else [] in spawn_command ?endpoint @@ -644,7 +642,7 @@ let import_signer_key ?endpoint ?force ?signer ~public_key_hash ~alias client = client |> Process.check -let import_public_key ?force ?endpoint client public_key ~alias = +let import_public_key ?force ?endpoint client ~public_key ~alias = spawn_import_public_key ?force ?endpoint client public_key ~alias |> Process.check diff --git a/tezt/lib_tezos/client.mli b/tezt/lib_tezos/client.mli index de8a984147d2f296170b862d4c82d5a6e34b49f4..2f23c53201acf504c44f1b99fafc4c2b3a231845 100644 --- a/tezt/lib_tezos/client.mli +++ b/tezt/lib_tezos/client.mli @@ -451,7 +451,7 @@ val import_public_key : ?force:bool -> ?endpoint:endpoint -> t -> - Account.secret_key -> + public_key:string -> alias:string -> unit Lwt.t diff --git a/tezt/tests/cloud/layer1.ml b/tezt/tests/cloud/layer1.ml index b99a3e7e39e8217590a854cf849887940ba8c076..df94149a790aef24295c7043fdb8972619607f92 100644 --- a/tezt/tests/cloud/layer1.ml +++ b/tezt/tests/cloud/layer1.ml @@ -268,9 +268,8 @@ module Node = struct let* yes_wallet = yes_wallet agent in let* () = Lwt_list.iter_s - (fun {pkh; pk} -> - let alias = pkh in - Client.import_public_key ~alias client @@ Unencrypted pk) + (fun {pkh = alias; pk = public_key} -> + Client.import_public_key ~alias ~public_key client) accounts in let* () = Yes_wallet.convert_wallet_inplace ~client yes_wallet in @@ -291,7 +290,7 @@ module Node = struct let* client = client ~node agent in let* yes_wallet = yes_wallet agent in let* () = Client.forget_all_keys client in - let* () = Client.import_public_key ~alias:pkh client @@ Unencrypted pk in + let* () = Client.import_public_key ~alias:pkh ~public_key:pk client in let* () = Yes_wallet.convert_wallet_inplace ~client yes_wallet in let* accounts = Client.stresstest_gen_keys diff --git a/tezt/tests/companion_key.ml b/tezt/tests/companion_key.ml index 8e492327e842ed21e2925572f9d1eb68ab206415..1da0ca8523a97bb18ecd5c0c5bb2b51c9e14d086 100644 --- a/tezt/tests/companion_key.ml +++ b/tezt/tests/companion_key.ml @@ -342,8 +342,10 @@ let test_update_companion_key_with_external_pop = Log.info "Import the key on the first client" ; let* () = - Client.import_public_key ~alias:"companion_key" client - @@ Unencrypted companion_key_bls.public_key + Client.import_public_key + ~alias:"companion_key" + ~public_key:companion_key_bls.public_key + client in Log.info "Updating companion key without secret key nor proof possession" ; let* () = diff --git a/tezt/tests/consensus_key.ml b/tezt/tests/consensus_key.ml index cc43338da66a635e4813e08ec28a2afa09f8bd1e..1d8d9877697f93df5697bbc4ccd55d142f5e132c 100644 --- a/tezt/tests/consensus_key.ml +++ b/tezt/tests/consensus_key.ml @@ -903,8 +903,10 @@ let test_update_consensus_key_with_external_pop = Log.info "Import the key on the first client" ; let* () = - Client.import_public_key ~alias:"consensus_key" client - @@ Unencrypted consensus_key_bls.public_key + Client.import_public_key + ~alias:"consensus_key" + ~public_key:consensus_key_bls.public_key + client in Log.info "Updating consensus key without secret key nor proof of possession" ; let* () =