mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-04 15:17:02 +00:00
Docker run.sh passes seeds and moniker; wire json pretty print
This commit is contained in:
@@ -3,6 +3,8 @@ package wire
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/tendermint/tendermint/Godeps/_workspace/src/code.google.com/p/go.crypto/ripemd160"
|
||||
|
||||
. "github.com/tendermint/tendermint/common"
|
||||
@@ -26,6 +28,21 @@ func JSONBytes(o interface{}) []byte {
|
||||
return w.Bytes()
|
||||
}
|
||||
|
||||
// NOTE: inefficient
|
||||
func JSONBytesPretty(o interface{}) []byte {
|
||||
jsonBytes := JSONBytes(o)
|
||||
var object interface{}
|
||||
err := json.Unmarshal(jsonBytes, &object)
|
||||
if err != nil {
|
||||
PanicSanity(err)
|
||||
}
|
||||
jsonBytes, err = json.MarshalIndent(object, "", "\t")
|
||||
if err != nil {
|
||||
PanicSanity(err)
|
||||
}
|
||||
return jsonBytes
|
||||
}
|
||||
|
||||
// NOTE: does not care about the type, only the binary representation.
|
||||
func BinaryEqual(a, b interface{}) bool {
|
||||
aBytes := BinaryBytes(a)
|
||||
|
||||
Reference in New Issue
Block a user