From 94948746a0c5c9d6e042328c0fb3a56b0f3b5dce Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Wed, 28 Feb 2018 15:36:21 +0100 Subject: [PATCH] rpc cli output uses wire.MarshalJSON --- client/rpc/block.go | 8 +++++--- client/rpc/status.go | 5 +++-- client/rpc/validators.go | 5 +++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/client/rpc/block.go b/client/rpc/block.go index bc127ddb21..3ae4e76156 100644 --- a/client/rpc/block.go +++ b/client/rpc/block.go @@ -1,13 +1,14 @@ package rpc import ( - "encoding/json" "fmt" "strconv" - "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" "github.com/spf13/viper" + + "github.com/cosmos/cosmos-sdk/client" + tmwire "github.com/tendermint/tendermint/wire" ) const ( @@ -54,7 +55,8 @@ func getBlock(cmd *cobra.Command, args []string) error { return err } - output, err := json.MarshalIndent(res, " ", "") + output, err := tmwire.MarshalJSON(res) + // output, err := json.MarshalIndent(res, " ", "") if err != nil { return err } diff --git a/client/rpc/status.go b/client/rpc/status.go index 61e922f4c6..9436a240a4 100644 --- a/client/rpc/status.go +++ b/client/rpc/status.go @@ -1,13 +1,13 @@ package rpc import ( - "encoding/json" "fmt" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/cosmos/cosmos-sdk/client" + tmwire "github.com/tendermint/tendermint/wire" ) func statusCommand() *cobra.Command { @@ -29,7 +29,8 @@ func checkStatus(cmd *cobra.Command, args []string) error { return err } - output, err := json.MarshalIndent(res, " ", "") + output, err := tmwire.MarshalJSON(res) + // output, err := json.MarshalIndent(res, " ", "") if err != nil { return err } diff --git a/client/rpc/validators.go b/client/rpc/validators.go index 143bbe17e6..cb554e7c6b 100644 --- a/client/rpc/validators.go +++ b/client/rpc/validators.go @@ -1,7 +1,6 @@ package rpc import ( - "encoding/json" "fmt" "strconv" @@ -9,6 +8,7 @@ import ( "github.com/spf13/viper" "github.com/cosmos/cosmos-sdk/client" + tmwire "github.com/tendermint/tendermint/wire" ) func validatorCommand() *cobra.Command { @@ -46,7 +46,8 @@ func getValidators(cmd *cobra.Command, args []string) error { return err } - output, err := json.MarshalIndent(res, " ", "") + output, err := tmwire.MarshalJSON(res) + // output, err := json.MarshalIndent(res, " ", "") if err != nil { return err }