Make sure we export hex not base64 for byte slices

This commit is contained in:
Ethan Frey 2017-05-30 18:28:25 +02:00
parent bcf3212462
commit 9444427d7e
2 changed files with 10 additions and 18 deletions

View File

@ -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 {

View File

@ -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 {