From 8772b232358840ff177f9022340d4dff3ad21f24 Mon Sep 17 00:00:00 2001 From: Sebastien Mondet Date: Fri, 14 Dec 2018 10:27:08 -0500 Subject: [PATCH] =?UTF-8?q?Make=20`register=20key=20..=20as=20delegate`=20?= =?UTF-8?q?=E2=80=9Cidempotent=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client_proto_context_commands.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml b/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml index d8594e6fe..9149fcccb 100644 --- a/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml +++ b/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml @@ -505,8 +505,14 @@ let commands version () = register_as_delegate cctxt ~chain:`Main ~block:cctxt#block ?confirmations:cctxt#confirmations ~dry_run ~fee_parameter - ?fee ~manager_sk:src_sk src_pk >>=? fun _res -> - return_unit + ?fee ~manager_sk:src_sk src_pk + >>= function + | Ok _ -> return_unit + | Error (Alpha_environment.Ecoproto_error + Proto_alpha.Proto.Delegate_storage.Active_delegate :: []) -> + cctxt#message "Delegate already activated." >>= fun () -> + return_unit + | Error el -> Lwt.return (Error el) end; ] @ (if version = (Some `Mainnet) then [] else [