Browse Source

Add GenesisDoc.SaveAs utility method

pull/164/head
Jae Kwon 9 years ago
parent
commit
09351996a4
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      types/genesis.go

+ 6
- 0
types/genesis.go 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


Loading…
Cancel
Save