From 22640246798e942beea0c32044d9d50b3b83a708 Mon Sep 17 00:00:00 2001 From: Forostovec Date: Tue, 7 Oct 2025 18:32:09 +0300 Subject: [PATCH] chore: remove dead String() methods in keys parse command (#25387) Co-authored-by: Alex | Cosmos Labs --- client/keys/parse.go | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/client/keys/parse.go b/client/keys/parse.go index 513e976853..1cfbbcb635 100644 --- a/client/keys/parse.go +++ b/client/keys/parse.go @@ -32,10 +32,6 @@ type hexOutput struct { Bytes string `json:"bytes"` } -func (ho hexOutput) String() string { - return fmt.Sprintf("Human readable part: %v\nBytes (hex): %s", ho.Human, ho.Bytes) -} - func newHexOutput(human string, bs []byte) hexOutput { return hexOutput{Human: human, Bytes: fmt.Sprintf("%X", bs)} } @@ -60,16 +56,6 @@ func newBech32Output(config *sdk.Config, bs []byte) bech32Output { return out } -func (bo bech32Output) String() string { - out := make([]string, len(bo.Formats)) - - for i, format := range bo.Formats { - out[i] = fmt.Sprintf(" - %s", format) - } - - return fmt.Sprintf("Bech32 Formats:\n%s", strings.Join(out, "\n")) -} - // ParseKeyStringCommand parses an address from hex to bech32 and vice versa. func ParseKeyStringCommand() *cobra.Command { cmd := &cobra.Command{ @@ -130,7 +116,7 @@ func runFromHex(config *sdk.Config, w io.Writer, hexstr, output string) bool { return true } -func displayParseKeyInfo(w io.Writer, stringer fmt.Stringer, output string) { +func displayParseKeyInfo(w io.Writer, value any, output string) { var ( err error out []byte @@ -138,10 +124,10 @@ func displayParseKeyInfo(w io.Writer, stringer fmt.Stringer, output string) { switch output { case flags.OutputFormatText: - out, err = yaml.Marshal(&stringer) + out, err = yaml.Marshal(&value) case flags.OutputFormatJSON: - out, err = json.Marshal(&stringer) + out, err = json.Marshal(&value) } if err != nil {