mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-06 12:02:13 +00:00
Merge pull request #494 from tendermint/json-naming
Clean up json output
This commit is contained in:
commit
c4ad0f76e6
@ -539,7 +539,7 @@ func (wsc *wsConnection) writeRoutine() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
case msg := <-wsc.writeChan:
|
case msg := <-wsc.writeChan:
|
||||||
jsonBytes, err := json.Marshal(msg)
|
jsonBytes, err := json.MarshalIndent(msg, "", " ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wsc.Logger.Error("Failed to marshal RPCResponse to JSON", "error", err)
|
wsc.Logger.Error("Failed to marshal RPCResponse to JSON", "error", err)
|
||||||
} else {
|
} else {
|
||||||
|
@ -48,7 +48,7 @@ func StartHTTPServer(listenAddr string, handler http.Handler, logger log.Logger)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func WriteRPCResponseHTTPError(w http.ResponseWriter, httpCode int, res types.RPCResponse) {
|
func WriteRPCResponseHTTPError(w http.ResponseWriter, httpCode int, res types.RPCResponse) {
|
||||||
jsonBytes, err := json.Marshal(res)
|
jsonBytes, err := json.MarshalIndent(res, "", " ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ func WriteRPCResponseHTTPError(w http.ResponseWriter, httpCode int, res types.RP
|
|||||||
}
|
}
|
||||||
|
|
||||||
func WriteRPCResponseHTTP(w http.ResponseWriter, res types.RPCResponse) {
|
func WriteRPCResponseHTTP(w http.ResponseWriter, res types.RPCResponse) {
|
||||||
jsonBytes, err := json.Marshal(res)
|
jsonBytes, err := json.MarshalIndent(res, "", " ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,9 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/tendermint/go-wire"
|
||||||
cmn "github.com/tendermint/tmlibs/common"
|
cmn "github.com/tendermint/tmlibs/common"
|
||||||
"github.com/tendermint/tmlibs/merkle"
|
"github.com/tendermint/tmlibs/merkle"
|
||||||
"github.com/tendermint/go-wire"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ValidatorSet represent a set of *Validator at a given height.
|
// ValidatorSet represent a set of *Validator at a given height.
|
||||||
@ -23,8 +23,9 @@ import (
|
|||||||
// TODO: consider validator Accum overflow
|
// TODO: consider validator Accum overflow
|
||||||
// TODO: move valset into an iavl tree where key is 'blockbonded|pubkey'
|
// TODO: move valset into an iavl tree where key is 'blockbonded|pubkey'
|
||||||
type ValidatorSet struct {
|
type ValidatorSet struct {
|
||||||
Validators []*Validator // NOTE: persisted via reflect, must be exported.
|
// NOTE: persisted via reflect, must be exported.
|
||||||
Proposer *Validator
|
Validators []*Validator `json:"validators"`
|
||||||
|
Proposer *Validator `json:"proposer"`
|
||||||
|
|
||||||
// cached (unexported)
|
// cached (unexported)
|
||||||
totalVotingPower int64
|
totalVotingPower int64
|
||||||
|
Loading…
x
Reference in New Issue
Block a user