Add GenesisDoc.SaveAs utility method

This commit is contained in:
Jae Kwon
2015-12-03 09:51:10 -08:00
parent 1df2d7b8eb
commit 09351996a4

View File

@@ -29,6 +29,12 @@ type GenesisDoc struct {
AppHash []byte `json:"app_hash"`
}
// Utility method for saving GenensisDoc as JSON file.
func (genDoc *GenesisDoc) SaveAs(file string) error {
genDocBytes := wire.JSONBytes(genDoc)
return WriteFile(file, genDocBytes)
}
//------------------------------------------------------------
// Make genesis state from file