Merge PR #3887: Add indent to prompt of gaiacli tx send
* Add indent to prompt of `gaiacli tx send`. * Add indent to prompt of `gaiacli tx send` with flag --indent.
This commit is contained in:
parent
868d44879c
commit
5081c930de
@ -3,6 +3,7 @@ package utils
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/spf13/viper"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
@ -69,7 +70,16 @@ func CompleteAndBroadcastTxCLI(txBldr authtxb.TxBuilder, cliCtx context.CLIConte
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Fprintf(os.Stderr, "%s\n\n", cliCtx.Codec.MustMarshalJSON(stdSignMsg))
|
||||
var json []byte
|
||||
if viper.GetBool(client.FlagIndentResponse) {
|
||||
json, err = cliCtx.Codec.MarshalJSONIndent(stdSignMsg, "", " ")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
} else {
|
||||
json = cliCtx.Codec.MustMarshalJSON(stdSignMsg)
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "%s\n\n", json)
|
||||
|
||||
buf := client.BufferStdin()
|
||||
ok, err := client.GetConfirmation("confirm transaction before signing and broadcasting", buf)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user