Nest switches
This commit is contained in:
parent
84aef0d106
commit
6c8791f505
|
@ -81,15 +81,21 @@ func makeSignCmd(cdc *amino.Codec, decoder auth.AccountDecoder) func(cmd *cobra.
|
||||||
|
|
||||||
var json []byte
|
var json []byte
|
||||||
|
|
||||||
switch {
|
switch generateSignatureOnly {
|
||||||
case generateSignatureOnly && cliCtx.Indent:
|
case true:
|
||||||
json, err = cdc.MarshalJSONIndent(newTx.Signatures[0], "", " ")
|
switch cliCtx.Indent {
|
||||||
case generateSignatureOnly && !cliCtx.Indent:
|
case true:
|
||||||
json, err = cdc.MarshalJSON(newTx.Signatures[0])
|
json, err = cdc.MarshalJSONIndent(newTx.Signatures[0], "", " ")
|
||||||
case !generateSignatureOnly && cliCtx.Indent:
|
default:
|
||||||
json, err = cdc.MarshalJSONIndent(newTx, "", " ")
|
json, err = cdc.MarshalJSON(newTx.Signatures[0])
|
||||||
case !generateSignatureOnly && !cliCtx.Indent:
|
}
|
||||||
json, err = cdc.MarshalJSON(newTx)
|
default:
|
||||||
|
switch cliCtx.Indent {
|
||||||
|
case true:
|
||||||
|
json, err = cdc.MarshalJSONIndent(newTx, "", " ")
|
||||||
|
default:
|
||||||
|
json, err = cdc.MarshalJSON(newTx)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue