From aa4bd0566825cb8b1e949be0a88d719b7d27e86d Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Wed, 28 Mar 2018 17:08:22 +0200 Subject: [PATCH] Allow clearing candidacy fields (closes #723) --- x/stake/handler.go | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/x/stake/handler.go b/x/stake/handler.go index b52731aed0..7449141aa6 100644 --- a/x/stake/handler.go +++ b/x/stake/handler.go @@ -126,19 +126,11 @@ func handleMsgEditCandidacy(ctx sdk.Context, msg MsgEditCandidacy, k Keeper) sdk } // XXX move to types - //check and edit any of the editable terms - if msg.Description.Moniker != "" { - candidate.Description.Moniker = msg.Description.Moniker - } - if msg.Description.Identity != "" { - candidate.Description.Identity = msg.Description.Identity - } - if msg.Description.Website != "" { - candidate.Description.Website = msg.Description.Website - } - if msg.Description.Details != "" { - candidate.Description.Details = msg.Description.Details - } + // replace all editable fields (clients should autofill existing values) + candidate.Description.Moniker = msg.Description.Moniker + candidate.Description.Identity = msg.Description.Identity + candidate.Description.Website = msg.Description.Website + candidate.Description.Details = msg.Description.Details k.setCandidate(ctx, candidate) return sdk.Result{}