types: bring back json.Marshal/Unmarshal for genesis/priv_val

This commit is contained in:
Ethan Buchman
2018-03-02 02:09:28 -05:00
parent eaafd9d61c
commit 6596bff8ec
3 changed files with 17 additions and 18 deletions

View File

@@ -8,7 +8,6 @@ import (
"github.com/pkg/errors"
crypto "github.com/tendermint/go-crypto"
"github.com/tendermint/tendermint/wire"
cmn "github.com/tendermint/tmlibs/common"
)
@@ -34,7 +33,7 @@ type GenesisDoc struct {
// SaveAs is a utility method for saving GenensisDoc as a JSON file.
func (genDoc *GenesisDoc) SaveAs(file string) error {
genDocBytes, err := wire.MarshalJSON(genDoc)
genDocBytes, err := json.Marshal(genDoc)
if err != nil {
return err
}
@@ -90,7 +89,7 @@ func (genDoc *GenesisDoc) ValidateAndComplete() error {
// GenesisDocFromJSON unmarshalls JSON data into a GenesisDoc.
func GenesisDocFromJSON(jsonBlob []byte) (*GenesisDoc, error) {
genDoc := GenesisDoc{}
err := wire.UnmarshalJSON(jsonBlob, &genDoc)
err := json.Unmarshal(jsonBlob, &genDoc)
if err != nil {
return nil, err
}