mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-20 08:26:31 +00:00
types: allow genesis file to have 0 validators (#2148)
* fixing issue 2015 * Remove comments for code review * Update tests
This commit is contained in:
@ -25,7 +25,7 @@ type GenesisDoc struct {
|
||||
GenesisTime time.Time `json:"genesis_time"`
|
||||
ChainID string `json:"chain_id"`
|
||||
ConsensusParams *ConsensusParams `json:"consensus_params,omitempty"`
|
||||
Validators []GenesisValidator `json:"validators"`
|
||||
Validators []GenesisValidator `json:"validators,omitempty"`
|
||||
AppHash cmn.HexBytes `json:"app_hash"`
|
||||
AppState json.RawMessage `json:"app_state,omitempty"`
|
||||
}
|
||||
@ -65,10 +65,6 @@ func (genDoc *GenesisDoc) ValidateAndComplete() error {
|
||||
}
|
||||
}
|
||||
|
||||
if len(genDoc.Validators) == 0 {
|
||||
return cmn.NewError("The genesis file must have at least one validator")
|
||||
}
|
||||
|
||||
for _, v := range genDoc.Validators {
|
||||
if v.Power == 0 {
|
||||
return cmn.NewError("The genesis file cannot contain validators with no voting power: %v", v)
|
||||
|
Reference in New Issue
Block a user