fix tests

This commit is contained in:
Ethan Buchman
2018-04-07 19:47:19 +03:00
parent 02c0835e9b
commit c68d406195
8 changed files with 42 additions and 23 deletions

View File

@ -2,7 +2,6 @@ package node
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"net"
@ -644,7 +643,7 @@ func loadGenesisDoc(db dbm.DB) (*types.GenesisDoc, error) {
return nil, errors.New("Genesis doc not found")
}
var genDoc *types.GenesisDoc
err := json.Unmarshal(bytes, &genDoc)
err := cdc.UnmarshalJSON(bytes, &genDoc)
if err != nil {
cmn.PanicCrisis(fmt.Sprintf("Failed to load genesis doc due to unmarshaling error: %v (bytes: %X)", err, bytes))
}
@ -653,7 +652,7 @@ func loadGenesisDoc(db dbm.DB) (*types.GenesisDoc, error) {
// panics if failed to marshal the given genesis document
func saveGenesisDoc(db dbm.DB, genDoc *types.GenesisDoc) {
bytes, err := json.Marshal(genDoc)
bytes, err := cdc.MarshalJSON(genDoc)
if err != nil {
cmn.PanicCrisis(fmt.Sprintf("Failed to save genesis doc due to marshaling error: %v", err))
}