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