Skip to content

Commit

Permalink
Nest switches
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Treglia committed Oct 29, 2018
1 parent fe89dc8 commit 9ab5733
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions x/auth/client/cli/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,21 @@ func makeSignCmd(cdc *amino.Codec, decoder auth.AccountDecoder) func(cmd *cobra.

var json []byte

switch {
case generateSignatureOnly && cliCtx.Indent:
json, err = cdc.MarshalJSONIndent(newTx.Signatures[0], "", " ")
case generateSignatureOnly && !cliCtx.Indent:
json, err = cdc.MarshalJSON(newTx.Signatures[0])
case !generateSignatureOnly && cliCtx.Indent:
json, err = cdc.MarshalJSONIndent(newTx, "", " ")
case !generateSignatureOnly && !cliCtx.Indent:
json, err = cdc.MarshalJSON(newTx)
switch generateSignatureOnly {
case true:
switch cliCtx.Indent {
case true:
json, err = cdc.MarshalJSONIndent(newTx.Signatures[0], "", " ")
default:
json, err = cdc.MarshalJSON(newTx.Signatures[0])
}
default:
switch cliCtx.Indent {
case true:
json, err = cdc.MarshalJSONIndent(newTx, "", " ")
default:
json, err = cdc.MarshalJSON(newTx)
}
}
if err != nil {
return err
Expand Down

0 comments on commit 9ab5733

Please sign in to comment.