diff --git a/cmd/commands/query.go b/cmd/commands/query.go index 05bd4f93ca..e31d625491 100644 --- a/cmd/commands/query.go +++ b/cmd/commands/query.go @@ -10,6 +10,7 @@ import ( "github.com/spf13/cobra" "github.com/tendermint/go-wire" + "github.com/tendermint/go-wire/data" "github.com/tendermint/merkleeyes/iavl" "github.com/tendermint/tendermint/rpc/client" tmtypes "github.com/tendermint/tendermint/types" @@ -101,9 +102,9 @@ func queryCmd(cmd *cobra.Command, args []string) error { height := resp.Height out, err := json.Marshal(struct { - Value []byte `json:"value"` - Proof []byte `json:"proof"` - Height uint64 `json:"height"` + Value data.Bytes `json:"value"` + Proof data.Bytes `json:"proof"` + Height uint64 `json:"height"` }{val, proof, height}) if err != nil { return err @@ -179,8 +180,8 @@ func blockCmd(cmd *cobra.Command, args []string) error { } type BlockHex struct { - Header []byte `json:"header"` - Commit []byte `json:"commit"` + Header data.Bytes `json:"header"` + Commit data.Bytes `json:"commit"` } type BlockJSON struct { diff --git a/cmd/commands/tx.go b/cmd/commands/tx.go index 81e304c9a9..70bc8e626b 100644 --- a/cmd/commands/tx.go +++ b/cmd/commands/tx.go @@ -2,7 +2,6 @@ package commands import ( "encoding/hex" - "encoding/json" "fmt" "strings" @@ -142,13 +141,9 @@ func sendTxCmd(cmd *cobra.Command, args []string) error { signBytes := tx.SignBytes(chainIDFlag) tx.Inputs[0].Signature = privKey.Sign(signBytes) - out, err := json.Marshal(tx) - if err != nil { - return err - } - + out := wire.BinaryBytes(tx) fmt.Println("Signed SendTx:") - fmt.Println(string(out)) + fmt.Printf("%X\n", out) // broadcast the transaction to tendermint data, log, err := broadcastTx(tx) @@ -203,13 +198,9 @@ func AppTx(name string, data []byte) error { tx.Input.Signature = privKey.Sign(tx.SignBytes(chainIDFlag)) - out, err := json.Marshal(tx) - if err != nil { - return err - } - + out := wire.BinaryBytes(tx) fmt.Println("Signed AppTx:") - fmt.Println(string(out)) + fmt.Printf("%X\n", out) data, log, err := broadcastTx(tx) if err != nil {