remove deprecated `app_options` field from genesis
This commit is contained in:
parent
37ce4e549e
commit
b271c40783
|
@ -1,5 +1,10 @@
|
|||
# Changelog
|
||||
|
||||
## TBD
|
||||
|
||||
IMPROVEMENTS:
|
||||
- [genesis] removed deprecated `app_options` field.
|
||||
|
||||
## 0.22.2
|
||||
|
||||
*July 10th, 2018*
|
||||
|
|
|
@ -273,7 +273,7 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight
|
|||
ChainId: h.genDoc.ChainID,
|
||||
ConsensusParams: csParams,
|
||||
Validators: validators,
|
||||
AppStateBytes: h.genDoc.AppStateJSON,
|
||||
AppStateBytes: h.genDoc.AppState,
|
||||
}
|
||||
res, err := proxyApp.Consensus().InitChainSync(req)
|
||||
if err != nil {
|
||||
|
|
|
@ -29,9 +29,8 @@ type Genesis struct {
|
|||
ConsensusParams *types.ConsensusParams `json:"consensus_params,omitempty"`
|
||||
Validators []GenesisValidator `json:"validators"`
|
||||
AppHash cmn.HexBytes `json:"app_hash"`
|
||||
AppStateJSON json.RawMessage `json:"app_state,omitempty"`
|
||||
AppState json.RawMessage `json:"app_state,omitempty"`
|
||||
AppOptions json.RawMessage `json:"app_options,omitempty"` // DEPRECATED
|
||||
|
||||
}
|
||||
|
||||
type NodeKey struct {
|
||||
|
@ -112,12 +111,12 @@ func convertGenesis(cdc *amino.Codec, jsonBytes []byte) ([]byte, error) {
|
|||
ChainID: genesis.ChainID,
|
||||
ConsensusParams: genesis.ConsensusParams,
|
||||
// Validators
|
||||
AppHash: genesis.AppHash,
|
||||
AppStateJSON: genesis.AppStateJSON,
|
||||
AppHash: genesis.AppHash,
|
||||
AppState: genesis.AppState,
|
||||
}
|
||||
|
||||
if genesis.AppOptions != nil {
|
||||
genesisNew.AppStateJSON = genesis.AppOptions
|
||||
genesisNew.AppState = genesis.AppOptions
|
||||
}
|
||||
|
||||
for _, v := range genesis.Validators {
|
||||
|
|
|
@ -26,17 +26,7 @@ type GenesisDoc struct {
|
|||
ConsensusParams *ConsensusParams `json:"consensus_params,omitempty"`
|
||||
Validators []GenesisValidator `json:"validators"`
|
||||
AppHash cmn.HexBytes `json:"app_hash"`
|
||||
AppStateJSON 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.18)
|
||||
func (genDoc *GenesisDoc) AppState() json.RawMessage {
|
||||
if len(genDoc.AppOptions) > 0 {
|
||||
return genDoc.AppOptions
|
||||
}
|
||||
return genDoc.AppStateJSON
|
||||
AppState json.RawMessage `json:"app_state,omitempty"`
|
||||
}
|
||||
|
||||
// SaveAs is a utility method for saving GenensisDoc as a JSON file.
|
||||
|
|
Loading…
Reference in New Issue