From f315a767ab48a4490054905c2c2194f88ce44b41 Mon Sep 17 00:00:00 2001 From: David Turner Date: Fri, 20 May 2022 13:16:07 -0400 Subject: [PATCH] Warning when attempting to delegate from an unrevealed key --- src/proto_alpha/lib_protocol/bootstrap_storage.ml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/proto_alpha/lib_protocol/bootstrap_storage.ml b/src/proto_alpha/lib_protocol/bootstrap_storage.ml index 62a38dae7711..1673e536938c 100644 --- a/src/proto_alpha/lib_protocol/bootstrap_storage.ml +++ b/src/proto_alpha/lib_protocol/bootstrap_storage.ml @@ -45,7 +45,20 @@ let init_account (ctxt, balance_updates) ctxt contract (Some (Option.value ~default:public_key_hash delegate_to)) - | None -> return ctxt) + | None -> + Option.iter + (fun delegate_to -> + Logging.( + log + Warning + "Attempt to delegate from an unrevealed key ignored: not \ + delegating %a to %a" + Signature.Public_key_hash.pp + public_key_hash + Signature.Public_key_hash.pp + delegate_to)) + delegate_to ; + return ctxt) >|=? fun ctxt -> (ctxt, new_balance_updates @ balance_updates) let init_contract ~typecheck (ctxt, balance_updates) -- GitLab