Skip to content

Commit

Permalink
more MarshalJSONIndent
Browse files Browse the repository at this point in the history
  • Loading branch information
ebuchman committed Apr 9, 2018
1 parent 9e2667b commit f5c285f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
9 changes: 0 additions & 9 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package baseapp

import (
"encoding/json"
"fmt"
"runtime/debug"

Expand Down Expand Up @@ -241,14 +240,6 @@ func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitC
app.setDeliverState(abci.Header{})
app.initChainer(app.deliverState.ctx, req) // no error

// Initialize module genesis state
genesisState := new(map[string]json.RawMessage)
err := json.Unmarshal(req.AppStateBytes, genesisState)
if err != nil {
// TODO Return something intelligent
panic(err)
}

// NOTE: we don't commit, but BeginBlock for block 1
// starts from this deliverState

Expand Down
3 changes: 1 addition & 2 deletions x/auth/commands/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package commands

import (
"encoding/hex"
"encoding/json"
"fmt"

"github.com/pkg/errors"
Expand Down Expand Up @@ -77,7 +76,7 @@ func (c commander) getAccountCmd(cmd *cobra.Command, args []string) error {
}

// print out whole account
output, err := json.MarshalIndent(account, "", " ")
output, err := wire.MarshalJSONIndent(c.cdc, account)
if err != nil {
return err
}
Expand Down
9 changes: 4 additions & 5 deletions x/stake/commands/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package commands

import (
"encoding/hex"
"encoding/json"
"fmt"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -59,7 +58,7 @@ func GetCmdQueryCandidates(cdc *wire.Codec, storeName string) *cobra.Command {
if err != nil {
return err
}
output, err := json.MarshalIndent(candidates, "", " ")
output, err := wire.MarshalJSONIndent(cdc, candidates)
if err != nil {
return err
}
Expand Down Expand Up @@ -101,7 +100,7 @@ func GetCmdQueryCandidate(cdc *wire.Codec, storeName string) *cobra.Command {
if err != nil {
return err
}
output, err := json.MarshalIndent(candidate, "", " ")
output, err := wire.MarshalJSONIndent(cdc, candidate)
if err != nil {
return err
}
Expand Down Expand Up @@ -149,7 +148,7 @@ func GetCmdQueryDelegatorBond(cdc *wire.Codec, storeName string) *cobra.Command
if err != nil {
return err
}
output, err := json.MarshalIndent(bond, "", " ")
output, err := wire.MarshalJSONIndent(cdc, bond)
if err != nil {
return err
}
Expand Down Expand Up @@ -193,7 +192,7 @@ func GetCmdQueryDelegatorBonds(cdc *wire.Codec, storeName string) *cobra.Command
if err != nil {
return err
}
output, err := json.MarshalIndent(candidates, "", " ")
output, err := wire.MarshalJSONIndent(cdc, candidates)
if err != nil {
return err
}
Expand Down

0 comments on commit f5c285f

Please sign in to comment.