(t *testing.T, height int64)
| 118 | } |
| 119 | |
| 120 | func setupStateStore(t *testing.T, height int64) state.Store { |
| 121 | stateStore := state.NewStore(dbm.NewMemDB(), state.StoreOptions{DiscardABCIResponses: false}) |
| 122 | valSet, _ := types.RandValidatorSet(5, 10) |
| 123 | |
| 124 | params := types.DefaultConsensusParams() |
| 125 | params.Version.AppVersion = 10 |
| 126 | |
| 127 | initialState := state.State{ |
| 128 | Version: tmstate.Version{ |
| 129 | Consensus: tmversion.Consensus{ |
| 130 | Block: version.BlockProtocol, |
| 131 | App: 10, |
| 132 | }, |
| 133 | Software: version.TMCoreSemVer, |
| 134 | }, |
| 135 | ChainID: "test-chain", |
| 136 | InitialHeight: 10, |
| 137 | LastBlockID: makeBlockIDRandom(), |
| 138 | AppHash: tmhash.Sum([]byte("app_hash")), |
| 139 | LastResultsHash: tmhash.Sum([]byte("last_results_hash")), |
| 140 | LastBlockHeight: height, |
| 141 | LastValidators: valSet, |
| 142 | Validators: valSet.CopyIncrementProposerPriority(1), |
| 143 | NextValidators: valSet.CopyIncrementProposerPriority(2), |
| 144 | LastHeightValidatorsChanged: height + 1, |
| 145 | ConsensusParams: *params, |
| 146 | LastHeightConsensusParamsChanged: height + 1, |
| 147 | } |
| 148 | require.NoError(t, stateStore.Bootstrap(initialState)) |
| 149 | return stateStore |
| 150 | } |
| 151 | |
| 152 | func makeBlockIDRandom() types.BlockID { |
| 153 | var ( |
no test coverage detected