Signer: explicit registration of signers
instead of toplevel side-effects and `-link-all`
This commit is contained in:
parent
502017c863
commit
0dbe24290f
@ -74,6 +74,12 @@ let main select_commands =
|
|||||||
ignore Clic.(setup_formatter Format.err_formatter
|
ignore Clic.(setup_formatter Format.err_formatter
|
||||||
(if Unix.isatty Unix.stderr then Ansi else Plain) Short) ;
|
(if Unix.isatty Unix.stderr then Ansi else Plain) Short) ;
|
||||||
init_logger () >>= fun () ->
|
init_logger () >>= fun () ->
|
||||||
|
Client_keys.register_signer
|
||||||
|
(module Tezos_signer_backends.Unencrypted) ;
|
||||||
|
Client_keys.register_signer
|
||||||
|
(module Tezos_signer_backends.Encrypted) ;
|
||||||
|
Client_keys.register_signer
|
||||||
|
(module Tezos_signer_backends.Remote) ;
|
||||||
Lwt.catch begin fun () -> begin
|
Lwt.catch begin fun () -> begin
|
||||||
Client_config.parse_config_args
|
Client_config.parse_config_args
|
||||||
(new unix_full
|
(new unix_full
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
tezos-client-commands
|
tezos-client-commands
|
||||||
tezos-stdlib-unix
|
tezos-stdlib-unix
|
||||||
tezos-rpc-http
|
tezos-rpc-http
|
||||||
|
tezos-signer-backends
|
||||||
pbkdf
|
pbkdf
|
||||||
bip39
|
bip39
|
||||||
tezos-shell-services))
|
tezos-shell-services))
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
open Client_keys
|
open Client_keys
|
||||||
|
|
||||||
module Encrypted_signer : SIGNER = struct
|
|
||||||
let scheme = "encrypted"
|
let scheme = "encrypted"
|
||||||
|
|
||||||
let title =
|
let title =
|
||||||
@ -211,7 +210,3 @@ module Encrypted_signer : SIGNER = struct
|
|||||||
let public_key x = return x
|
let public_key x = return x
|
||||||
let public_key_hash x = return (Signature.Public_key.hash x)
|
let public_key_hash x = return (Signature.Public_key.hash x)
|
||||||
let sign ?watermark t buf = return (Signature.sign ?watermark t buf)
|
let sign ?watermark t buf = return (Signature.sign ?watermark t buf)
|
||||||
end
|
|
||||||
|
|
||||||
let () =
|
|
||||||
register_signer (module Encrypted_signer)
|
|
||||||
|
10
src/lib_signer_backends/encrypted.mli
Normal file
10
src/lib_signer_backends/encrypted.mli
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
(**************************************************************************)
|
||||||
|
(* *)
|
||||||
|
(* Copyright (c) 2014 - 2017. *)
|
||||||
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
||||||
|
(* *)
|
||||||
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
||||||
|
(* *)
|
||||||
|
(**************************************************************************)
|
||||||
|
|
||||||
|
include Client_keys.SIGNER
|
@ -15,7 +15,7 @@
|
|||||||
-open Tezos_client_base
|
-open Tezos_client_base
|
||||||
-open Tezos_signer_services
|
-open Tezos_signer_services
|
||||||
-open Tezos_rpc_http
|
-open Tezos_rpc_http
|
||||||
-linkall -w -9))))
|
-w -9))))
|
||||||
|
|
||||||
(alias
|
(alias
|
||||||
((name runtest_indent)
|
((name runtest_indent)
|
||||||
|
@ -166,5 +166,4 @@ module Remote_signer : SIGNER = struct
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
let () =
|
include Remote_signer
|
||||||
register_signer (module Remote_signer)
|
|
||||||
|
10
src/lib_signer_backends/remote.mli
Normal file
10
src/lib_signer_backends/remote.mli
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
(**************************************************************************)
|
||||||
|
(* *)
|
||||||
|
(* Copyright (c) 2014 - 2017. *)
|
||||||
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
||||||
|
(* *)
|
||||||
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
||||||
|
(* *)
|
||||||
|
(**************************************************************************)
|
||||||
|
|
||||||
|
include Client_keys.SIGNER
|
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
open Client_keys
|
open Client_keys
|
||||||
|
|
||||||
module Unencrypted_signer : SIGNER = struct
|
|
||||||
let scheme = "unencrypted"
|
let scheme = "unencrypted"
|
||||||
|
|
||||||
let title =
|
let title =
|
||||||
@ -67,7 +66,3 @@ module Unencrypted_signer : SIGNER = struct
|
|||||||
let public_key x = return x
|
let public_key x = return x
|
||||||
let public_key_hash x = return (Signature.Public_key.hash x)
|
let public_key_hash x = return (Signature.Public_key.hash x)
|
||||||
let sign ?watermark t buf = return (Signature.sign ?watermark t buf)
|
let sign ?watermark t buf = return (Signature.sign ?watermark t buf)
|
||||||
end
|
|
||||||
|
|
||||||
let () =
|
|
||||||
register_signer (module Unencrypted_signer)
|
|
||||||
|
10
src/lib_signer_backends/unencrypted.mli
Normal file
10
src/lib_signer_backends/unencrypted.mli
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
(**************************************************************************)
|
||||||
|
(* *)
|
||||||
|
(* Copyright (c) 2014 - 2017. *)
|
||||||
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
||||||
|
(* *)
|
||||||
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
||||||
|
(* *)
|
||||||
|
(**************************************************************************)
|
||||||
|
|
||||||
|
include Client_keys.SIGNER
|
@ -616,3 +616,7 @@ let display_level block =
|
|||||||
|
|
||||||
let endorsement_security_deposit block =
|
let endorsement_security_deposit block =
|
||||||
Constants_services.endorsement_security_deposit !rpc_ctxt block
|
Constants_services.endorsement_security_deposit !rpc_ctxt block
|
||||||
|
|
||||||
|
let () =
|
||||||
|
Client_keys.register_signer
|
||||||
|
(module Tezos_signer_backends.Unencrypted)
|
||||||
|
Loading…
Reference in New Issue
Block a user