mirror of
https://github.com/tendermint/tendermint.git
synced 2026-04-04 15:59:06 +00:00
add updated validator set to node test
This commit is contained in:
@@ -159,6 +159,7 @@ func (store dbStore) save(state State, key []byte) error {
|
||||
}
|
||||
}
|
||||
// Save next validators.
|
||||
fmt.Println("saving validators for height ", nextHeight+1)
|
||||
err := store.saveValidatorsInfo(nextHeight+1, state.LastHeightValidatorsChanged, state.NextValidators, batch)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -442,7 +442,7 @@ func TestMaxProposalBlockSize(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
defer os.RemoveAll(cfg.RootDir)
|
||||
|
||||
logger := log.NewNopLogger()
|
||||
logger := log.NewTestingLogger(t)
|
||||
|
||||
cc := abciclient.NewLocalClient(logger, kvstore.NewApplication())
|
||||
proxyApp := proxy.New(cc, logger, proxy.NopMetrics())
|
||||
@@ -497,10 +497,16 @@ func TestMaxProposalBlockSize(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
// save the updated validator set for use by the block executor.
|
||||
state.LastBlockHeight = math.MaxInt64 - 3
|
||||
state.LastHeightValidatorsChanged = math.MaxInt64 - 1
|
||||
state.NextValidators = state.Validators.Copy()
|
||||
require.NoError(t, stateStore.Save(state))
|
||||
|
||||
timestamp := time.Date(math.MaxInt64, 0, 0, 0, 0, 0, math.MaxInt64, time.UTC)
|
||||
// change state in order to produce the largest accepted header
|
||||
state.LastBlockID = blockID
|
||||
state.LastBlockHeight = math.MaxInt64 - 1
|
||||
state.LastBlockHeight = math.MaxInt64 - 2
|
||||
state.LastBlockTime = timestamp
|
||||
state.LastResultsHash = tmhash.Sum([]byte("last_results_hash"))
|
||||
state.AppHash = tmhash.Sum([]byte("app_hash"))
|
||||
|
||||
Reference in New Issue
Block a user