mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 12:51:22 +00:00
ConsensusParams ptr in GenesisDoc for json
This commit is contained in:
@ -26,7 +26,7 @@ type GenesisValidator struct {
|
||||
type GenesisDoc struct {
|
||||
GenesisTime time.Time `json:"genesis_time"`
|
||||
ChainID string `json:"chain_id"`
|
||||
ConsensusParams ConsensusParams `json:"consensus_params"`
|
||||
ConsensusParams *ConsensusParams `json:"consensus_params,omitempty"`
|
||||
Validators []GenesisValidator `json:"validators"`
|
||||
AppHash data.Bytes `json:"app_hash"`
|
||||
}
|
||||
@ -58,8 +58,7 @@ func (genDoc *GenesisDoc) ValidateAndComplete() error {
|
||||
return errors.Errorf("Genesis doc must include non-empty chain_id")
|
||||
}
|
||||
|
||||
var emptyParams ConsensusParams
|
||||
if genDoc.ConsensusParams == emptyParams {
|
||||
if genDoc.ConsensusParams == nil {
|
||||
genDoc.ConsensusParams = DefaultConsensusParams()
|
||||
} else {
|
||||
if err := genDoc.ConsensusParams.Validate(); err != nil {
|
||||
|
Reference in New Issue
Block a user