From fd72b47263a8ee2b0841532e253114154ced1c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Sat, 26 May 2018 17:32:10 +0200 Subject: [PATCH] Opam: fix dependencies --- src/bin_client/tezos-client.opam | 1 + src/bin_signer/tezos-signer.opam | 11 ++- src/lib_client_base/jbuild | 2 - src/lib_client_base_unix/jbuild | 2 - .../tezos-client-base-unix.opam | 3 + .../tezos-client-commands.opam | 7 +- src/lib_signer_backends/encrypted.ml | 69 ------------------- .../tezos-signer-backends.opam | 6 +- src/lib_signer_backends/unencrypted.ml | 14 ---- .../tezos-signer-services.opam | 2 +- .../tezos-baking-alpha-commands.opam | 1 + .../lib_client/tezos-client-alpha.opam | 1 + 12 files changed, 20 insertions(+), 99 deletions(-) diff --git a/src/bin_client/tezos-client.opam b/src/bin_client/tezos-client.opam index 8d1f66c55..bced1cae7 100644 --- a/src/bin_client/tezos-client.opam +++ b/src/bin_client/tezos-client.opam @@ -17,6 +17,7 @@ depends: [ "tezos-baking-alpha" "tezos-baking-alpha-commands" "tezos-client-base-unix" + "tezos-signer-backends" "tezos-node" { test } ] build: [ diff --git a/src/bin_signer/tezos-signer.opam b/src/bin_signer/tezos-signer.opam index 8d1f66c55..768662727 100644 --- a/src/bin_signer/tezos-signer.opam +++ b/src/bin_signer/tezos-signer.opam @@ -11,13 +11,12 @@ depends: [ "jbuilder" { build & = "1.0+beta19.1" } "tezos-base" "tezos-client-base" - "tezos-client-genesis" - "tezos-client-alpha" - "tezos-client-alpha-commands" - "tezos-baking-alpha" - "tezos-baking-alpha-commands" "tezos-client-base-unix" - "tezos-node" { test } + "tezos-client-commands" + "tezos-signer-services" + "tezos-rpc-http" + "tezos-stdlib-unix" + "tezos-signer-backends" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/src/lib_client_base/jbuild b/src/lib_client_base/jbuild index e275395d1..156f7a078 100644 --- a/src/lib_client_base/jbuild +++ b/src/lib_client_base/jbuild @@ -4,7 +4,6 @@ ((name tezos_client_base) (public_name tezos-client-base) (libraries (tezos-base - tezos-stdlib-unix tezos-shell-services tezos-rpc)) (library_flags (:standard -linkall)) @@ -12,7 +11,6 @@ -safe-string -open Tezos_base__TzPervasives -open Tezos_rpc - -open Tezos_stdlib_unix -open Tezos_shell_services)))) (alias diff --git a/src/lib_client_base_unix/jbuild b/src/lib_client_base_unix/jbuild index c4aef11d7..e1a863e6f 100644 --- a/src/lib_client_base_unix/jbuild +++ b/src/lib_client_base_unix/jbuild @@ -9,8 +9,6 @@ tezos-stdlib-unix tezos-rpc-http tezos-signer-backends - pbkdf - bip39 tezos-shell-services)) (flags (:standard -w -9+27-30-32-40@8 -safe-string diff --git a/src/lib_client_base_unix/tezos-client-base-unix.opam b/src/lib_client_base_unix/tezos-client-base-unix.opam index 1fcbf3280..5a457ec4f 100644 --- a/src/lib_client_base_unix/tezos-client-base-unix.opam +++ b/src/lib_client_base_unix/tezos-client-base-unix.opam @@ -11,6 +11,9 @@ depends: [ "jbuilder" { build & = "1.0+beta19.1" } "tezos-base" "tezos-client-base" + "tezos-stdlib-unix" + "tezos-rpc-http" + "tezos-signer-backends" "tezos-client-commands" ] build: [ diff --git a/src/lib_client_commands/tezos-client-commands.opam b/src/lib_client_commands/tezos-client-commands.opam index 00343ca0f..12d37b7cf 100644 --- a/src/lib_client_commands/tezos-client-commands.opam +++ b/src/lib_client_commands/tezos-client-commands.opam @@ -10,11 +10,10 @@ depends: [ "ocamlfind" { build } "jbuilder" { build & = "1.0+beta19.1" } "tezos-base" - "tezos-stdlib-unix" - "tezos-shell-services" - "tezos-storage" - "tezos-rpc-http" "tezos-client-base" + "tezos-rpc" + "tezos-shell-services" + "tezos-signer-backends" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/src/lib_signer_backends/encrypted.ml b/src/lib_signer_backends/encrypted.ml index b1e98122e..3ba295189 100644 --- a/src/lib_signer_backends/encrypted.ml +++ b/src/lib_signer_backends/encrypted.ml @@ -119,75 +119,6 @@ let encrypt cctxt sk = Hashtbl.replace decrypted sk_uri sk ; return sk_uri -(* - - let rec get_boolean_answer (cctxt : #Client_context.io_wallet) ~default ~msg = - let prompt = if default then "(Y/n/q)" else "(y/N/q)" in - cctxt#prompt "%s %s: " msg prompt >>= fun gen -> - match default, String.lowercase_ascii gen with - | default, "" -> return default - | _, "y" -> return true - | _, "n" -> return false - | _, "q" -> failwith "Exit by user request." - | _ -> get_boolean_answer cctxt ~msg ~default - - let rec sk_of_mnemonic (cctxt : #Client_context.io_wallet) = - cctxt#prompt "Enter the e-mail used for the paper wallet: " >>= fun email -> - let rec loop_words acc i = - if i > 14 then Lwt.return (List.rev acc) else - cctxt#prompt_password "Enter word %d: " i >>= fun word -> - match Bip39.index_of_word word with - | None -> loop_words acc i - | Some wordidx -> loop_words (wordidx :: acc) (succ i) in - loop_words [] 0 >>= fun words -> - match Bip39.of_indices words with - | None -> assert false - | Some t -> - cctxt#prompt_password - "Enter the password used for the paper wallet: " >>= fun password -> - (* TODO: unicode normalization (NFKD)... *) - let sk = Bip39.to_seed ~passphrase:(email ^ password) t in - let sk = Cstruct.(to_bigarray (sub sk 0 32)) in - let sk : Signature.Secret_key.t = - Ed25519 - (Data_encoding.Binary.of_bytes_exn Ed25519.Secret_key.encoding sk) in - let pk = Signature.Secret_key.to_public_key sk in - let pkh = Signature.Public_key.hash pk in - let msg = Format.asprintf - "Your public Tezos address is %a is that correct?" - Signature.Public_key_hash.pp pkh in - get_boolean_answer cctxt ~msg ~default:true >>=? function - | true -> return sk - | false -> sk_of_mnemonic cctxt -*) -(* -let sk_locator_of_human_input cctxt = function - | sk :: _ -> - Lwt.return (Signature.Secret_key.of_b58check sk) >>=? fun sk -> - encrypt_sk cctxt sk - | [] -> begin - get_boolean_answer - cctxt ~msg:"Generate a new key" ~default:true >>=? function - | true -> - let _, _, sk = Signature.generate_key () in - encrypt_sk cctxt sk - | false -> - get_boolean_answer cctxt - ~msg:"Import key from fundraiser" ~default:true >>=? function - | false -> failwith "Goodbye." - | true -> - sk_of_mnemonic cctxt >>=? fun sk -> - encrypt_sk cctxt sk - end - *) - -(* -let pk_locator_of_human_input _cctxt = function - | [] -> failwith "Missing public key argument." - | pk :: _ -> return (Public_key_locator.create ~scheme ~location:[pk]) -*) - - module Make(C : sig val cctxt: Client_context.prompter end) = struct let scheme = "encrypted" diff --git a/src/lib_signer_backends/tezos-signer-backends.opam b/src/lib_signer_backends/tezos-signer-backends.opam index 1fcbf3280..0d49bb839 100644 --- a/src/lib_signer_backends/tezos-signer-backends.opam +++ b/src/lib_signer_backends/tezos-signer-backends.opam @@ -10,8 +10,12 @@ depends: [ "ocamlfind" { build } "jbuilder" { build & = "1.0+beta19.1" } "tezos-base" + "tezos-stdlib-unix" "tezos-client-base" - "tezos-client-commands" + "tezos-rpc-http" + "tezos-signer-services" + "pbkdf" + "bip39" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/src/lib_signer_backends/unencrypted.ml b/src/lib_signer_backends/unencrypted.ml index f9a0826c7..b9ca5aad7 100644 --- a/src/lib_signer_backends/unencrypted.ml +++ b/src/lib_signer_backends/unencrypted.ml @@ -22,20 +22,6 @@ let description = The format for importing public keys is the raw Base58-encoded \ key (starting with 'edpk')." -(* -let sk_locator_of_human_input _cctxt = function - | sk :: _ -> - return (Secret_key_locator.create ~scheme ~location:[sk]) - | [] -> - let _, _, sk = Ed25519.generate_key () in - return (Secret_key_locator.create ~scheme - ~location:[Ed25519.Secret_key.to_b58check sk]) - -let pk_locator_of_human_input _cctxt = function - | [] -> failwith "Missing public key argument" - | pk :: _ -> return (Public_key_locator.create ~scheme ~location:[pk]) - -*) let secret_key sk_uri = Lwt.return (Signature.Secret_key.of_b58check (Uri.path (sk_uri : sk_uri :> Uri.t))) diff --git a/src/lib_signer_services/tezos-signer-services.opam b/src/lib_signer_services/tezos-signer-services.opam index 1fcbf3280..e815ae347 100644 --- a/src/lib_signer_services/tezos-signer-services.opam +++ b/src/lib_signer_services/tezos-signer-services.opam @@ -11,7 +11,7 @@ depends: [ "jbuilder" { build & = "1.0+beta19.1" } "tezos-base" "tezos-client-base" - "tezos-client-commands" + "tezos-rpc" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/src/proto_alpha/lib_baking/tezos-baking-alpha-commands.opam b/src/proto_alpha/lib_baking/tezos-baking-alpha-commands.opam index 2a7c1f6a7..0fff70d14 100644 --- a/src/proto_alpha/lib_baking/tezos-baking-alpha-commands.opam +++ b/src/proto_alpha/lib_baking/tezos-baking-alpha-commands.opam @@ -17,6 +17,7 @@ depends: [ "tezos-client-commands" "tezos-client-alpha" "tezos-baking-alpha" + "tezos-signer-backends" { test } ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ] diff --git a/src/proto_alpha/lib_client/tezos-client-alpha.opam b/src/proto_alpha/lib_client/tezos-client-alpha.opam index 047225271..014c67314 100644 --- a/src/proto_alpha/lib_client/tezos-client-alpha.opam +++ b/src/proto_alpha/lib_client/tezos-client-alpha.opam @@ -14,6 +14,7 @@ depends: [ "tezos-protocol-alpha" "tezos-shell-services" "tezos-client-base" + "tezos-signer-backends" ] build: [ [ "jbuilder" "build" "-p" name "-j" jobs ]