rpc cli output uses wire.MarshalJSON
This commit is contained in:
parent
bb74e84b29
commit
94948746a0
|
@ -1,13 +1,14 @@
|
||||||
package rpc
|
package rpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
tmwire "github.com/tendermint/tendermint/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -54,7 +55,8 @@ func getBlock(cmd *cobra.Command, args []string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
output, err := json.MarshalIndent(res, " ", "")
|
output, err := tmwire.MarshalJSON(res)
|
||||||
|
// output, err := json.MarshalIndent(res, " ", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package rpc
|
package rpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
tmwire "github.com/tendermint/tendermint/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func statusCommand() *cobra.Command {
|
func statusCommand() *cobra.Command {
|
||||||
|
@ -29,7 +29,8 @@ func checkStatus(cmd *cobra.Command, args []string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
output, err := json.MarshalIndent(res, " ", "")
|
output, err := tmwire.MarshalJSON(res)
|
||||||
|
// output, err := json.MarshalIndent(res, " ", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package rpc
|
package rpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
@ -9,6 +8,7 @@ import (
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
tmwire "github.com/tendermint/tendermint/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func validatorCommand() *cobra.Command {
|
func validatorCommand() *cobra.Command {
|
||||||
|
@ -46,7 +46,8 @@ func getValidators(cmd *cobra.Command, args []string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
output, err := json.MarshalIndent(res, " ", "")
|
output, err := tmwire.MarshalJSON(res)
|
||||||
|
// output, err := json.MarshalIndent(res, " ", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue