rpc cli output uses wire.MarshalJSON

This commit is contained in:
Ethan Frey
2018-03-01 02:36:57 +00:00
committed by rigelrozanski
parent bb74e84b29
commit 94948746a0
3 changed files with 11 additions and 7 deletions
+5 -3
View File
@@ -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
}
+3 -2
View File
@@ -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
}
+3 -2
View File
@@ -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
}