|
|
@ -28,7 +28,18 @@ type GenesisDoc struct { |
|
|
|
ConsensusParams *ConsensusParams `json:"consensus_params,omitempty"` |
|
|
|
Validators []GenesisValidator `json:"validators"` |
|
|
|
AppHash cmn.HexBytes `json:"app_hash"` |
|
|
|
AppState json.RawMessage `json:"app_state,omitempty"` |
|
|
|
_AppState json.RawMessage `json:"app_state,omitempty"` |
|
|
|
AppOptions json.RawMessage `json:"app_options,omitempty"` // DEPRECATED
|
|
|
|
} |
|
|
|
|
|
|
|
// AppState returns raw application state.
|
|
|
|
// TODO: replace with AppState field during next breaking release (0.17)
|
|
|
|
func (genDoc *GenesisDoc) AppState() json.RawMessage { |
|
|
|
if len(genDoc.AppOptions) > 0 { |
|
|
|
return genDoc.AppOptions |
|
|
|
} else { |
|
|
|
return genDoc._AppState |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// SaveAs is a utility method for saving GenensisDoc as a JSON file.
|
|
|
|