diff --git a/client/tx/tx.go b/client/tx/tx.go index 5ea3d1995a..98d72b84d7 100644 --- a/client/tx/tx.go +++ b/client/tx/tx.go @@ -2,6 +2,7 @@ package tx import ( "encoding/hex" + "encoding/json" "fmt" "github.com/pkg/errors" @@ -56,8 +57,7 @@ func queryTx(cmd *cobra.Command, args []string) error { return err } - cdc := app.MakeTxCodec() - output, err := cdc.MarshalJSON(info) + output, err := json.MarshalIndent(info, "", " ") if err != nil { return err } @@ -67,19 +67,16 @@ func queryTx(cmd *cobra.Command, args []string) error { } func formatTxResult(res *ctypes.ResultTx) (txInfo, error) { - height := res.Height - result := res.TxResult // TODO: verify the proof if requested - tx, err := parseTx(res.Tx) if err != nil { return txInfo{}, err } info := txInfo{ - Height: height, + Height: res.Height, Tx: tx, - Result: result, + Result: res.TxResult, } return info, nil } diff --git a/tests/check_basecli.sh b/tests/check_basecli.sh index e21cb897c4..b470ea218a 100755 --- a/tests/check_basecli.sh +++ b/tests/check_basecli.sh @@ -54,5 +54,8 @@ echo; echo "Empty account got some cash" echo; echo "View tx" ./build/basecli tx $HASH -# shutdown +# shutdown, but add a sleep if you want to manually run some cli scripts +# against this server before it goes away +# sleep 120 kill $PID_SERVER + diff --git a/types/signature.go b/types/signature.go index 7fecc5fe96..5bca2f6069 100644 --- a/types/signature.go +++ b/types/signature.go @@ -4,7 +4,7 @@ import crypto "github.com/tendermint/go-crypto" // Standard Signature type StdSignature struct { - crypto.PubKey // optional - crypto.Signature - Sequence int64 + crypto.PubKey `json:"pub_key"` // optional + crypto.Signature `json:"signature"` + Sequence int64 `json:"sequence"` } diff --git a/types/tx_msg.go b/types/tx_msg.go index 8763075b8b..1a7f63f938 100644 --- a/types/tx_msg.go +++ b/types/tx_msg.go @@ -52,8 +52,8 @@ var _ Tx = (*StdTx)(nil) // StdTx is a standard way to wrap a Msg with Signatures. // NOTE: the first signature is the FeePayer (Signatures must not be nil). type StdTx struct { - Msg - Signatures []StdSignature + Msg `json:"msg"` + Signatures []StdSignature `json:"signatures"` } func NewStdTx(msg Msg, sigs []StdSignature) StdTx {