mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-23 01:41:31 +00:00
[R4R] Pass nil to NewValidatorSet() when genesis file's Validators field is nil (#2617)
* Pass nil to NewValidatorSet() when genesis file's Validators field is nil Closes: #2616 * Update CHANGELOG_PENDING.md
This commit is contained in:
committed by
Ethan Buchman
parent
7b48ea1788
commit
3744e8271d
@ -48,6 +48,19 @@ func TestStateCopy(t *testing.T) {
|
||||
%v`, state))
|
||||
}
|
||||
|
||||
//TestMakeGenesisStateNilValidators tests state's consistency when genesis file's validators field is nil.
|
||||
func TestMakeGenesisStateNilValidators(t *testing.T) {
|
||||
doc := types.GenesisDoc{
|
||||
ChainID: "dummy",
|
||||
Validators: nil,
|
||||
}
|
||||
require.Nil(t, doc.ValidateAndComplete())
|
||||
state, err := MakeGenesisState(&doc)
|
||||
require.Nil(t, err)
|
||||
require.Equal(t, 0, len(state.Validators.Validators))
|
||||
require.Equal(t, 0, len(state.NextValidators.Validators))
|
||||
}
|
||||
|
||||
// TestStateSaveLoad tests saving and loading State from a db.
|
||||
func TestStateSaveLoad(t *testing.T) {
|
||||
tearDown, stateDB, state := setupTestCase(t)
|
||||
|
Reference in New Issue
Block a user