Pretty print JSON

This commit is contained in:
Jae Kwon
2016-03-19 16:58:15 -07:00
parent 3f6f149584
commit 9b4b533f2f
4 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ type GenesisDoc struct {
// Utility method for saving GenensisDoc as JSON file.
func (genDoc *GenesisDoc) SaveAs(file string) error {
genDocBytes := wire.JSONBytes(genDoc)
genDocBytes := wire.JSONBytesPretty(genDoc)
return WriteFile(file, genDocBytes, 0644)
}
+1 -1
View File
@@ -141,7 +141,7 @@ func (privVal *PrivValidator) save() {
if privVal.filePath == "" {
PanicSanity("Cannot save PrivValidator: filePath not set")
}
jsonBytes := wire.JSONBytes(privVal)
jsonBytes := wire.JSONBytesPretty(privVal)
err := WriteFileAtomic(privVal.filePath, jsonBytes, 0600)
if err != nil {
// `@; BOOM!!!