You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

282 lines
8.0 KiB

state: add more tests for block validation (#3674) * Expose priv validators for use in testing * Generalize block header validation test past height 1 * Remove ineffectual assignment * Remove redundant SaveState call * Reorder comment for clarity * Use the block executor ApplyBlock function instead of implementing a stripped-down version of it * Remove commented-out code * Remove unnecessary test The required tests already appear to be implemented (implicitly) through the TestValidateBlockHeader test. * Allow for catching of specific error types during TestValidateBlockCommit * Make return error testable * Clean up and add TestValidateBlockCommit code * Fix formatting * Extract function to create a new mock test app * Update comment for clarity * Fix comment * Add skeleton code for evidence-related test * Allow for addressing priv val by address * Generalize test beyond a single validator * Generalize TestValidateBlockEvidence past first height * Reorder code to clearly separate tests and utility code * Use a common constant for stop height for testing in state/validation_test.go * Refactor errors to resemble existing conventions * Fix formatting * Extract common helper functions Having the tests littered with helper functions makes them less easily readable imho, so I've pulled them out into a separate file. This also makes it easier to see what helper functions are available during testing, so we minimize the chance of duplication when writing new tests. * Remove unused parameter * Remove unused parameters * Add field keys * Remove unused height constant * Fix typo * Fix incorrect return error * Add field keys * Use separate package for tests This refactors all of the state package's tests into a state_test package, so as to keep any usage of the state package's internal methods explicit. Any internal methods/constants used by tests are now explicitly exported in state/export_test.go * Refactor: extract helper function to make, validate, execute and commit a block * Rename state function to makeState * Remove redundant constant for number of validators * Refactor mock evidence registration into TestMain * Remove extraneous nVals variable * Replace function-level TODOs with file-level TODO and explanation * Remove extraneous comment * Fix linting issues brought up by GolangCI (pulled in from latest merge from develop)
5 years ago
state: add more tests for block validation (#3674) * Expose priv validators for use in testing * Generalize block header validation test past height 1 * Remove ineffectual assignment * Remove redundant SaveState call * Reorder comment for clarity * Use the block executor ApplyBlock function instead of implementing a stripped-down version of it * Remove commented-out code * Remove unnecessary test The required tests already appear to be implemented (implicitly) through the TestValidateBlockHeader test. * Allow for catching of specific error types during TestValidateBlockCommit * Make return error testable * Clean up and add TestValidateBlockCommit code * Fix formatting * Extract function to create a new mock test app * Update comment for clarity * Fix comment * Add skeleton code for evidence-related test * Allow for addressing priv val by address * Generalize test beyond a single validator * Generalize TestValidateBlockEvidence past first height * Reorder code to clearly separate tests and utility code * Use a common constant for stop height for testing in state/validation_test.go * Refactor errors to resemble existing conventions * Fix formatting * Extract common helper functions Having the tests littered with helper functions makes them less easily readable imho, so I've pulled them out into a separate file. This also makes it easier to see what helper functions are available during testing, so we minimize the chance of duplication when writing new tests. * Remove unused parameter * Remove unused parameters * Add field keys * Remove unused height constant * Fix typo * Fix incorrect return error * Add field keys * Use separate package for tests This refactors all of the state package's tests into a state_test package, so as to keep any usage of the state package's internal methods explicit. Any internal methods/constants used by tests are now explicitly exported in state/export_test.go * Refactor: extract helper function to make, validate, execute and commit a block * Rename state function to makeState * Remove redundant constant for number of validators * Refactor mock evidence registration into TestMain * Remove extraneous nVals variable * Replace function-level TODOs with file-level TODO and explanation * Remove extraneous comment * Fix linting issues brought up by GolangCI (pulled in from latest merge from develop)
5 years ago
state: add more tests for block validation (#3674) * Expose priv validators for use in testing * Generalize block header validation test past height 1 * Remove ineffectual assignment * Remove redundant SaveState call * Reorder comment for clarity * Use the block executor ApplyBlock function instead of implementing a stripped-down version of it * Remove commented-out code * Remove unnecessary test The required tests already appear to be implemented (implicitly) through the TestValidateBlockHeader test. * Allow for catching of specific error types during TestValidateBlockCommit * Make return error testable * Clean up and add TestValidateBlockCommit code * Fix formatting * Extract function to create a new mock test app * Update comment for clarity * Fix comment * Add skeleton code for evidence-related test * Allow for addressing priv val by address * Generalize test beyond a single validator * Generalize TestValidateBlockEvidence past first height * Reorder code to clearly separate tests and utility code * Use a common constant for stop height for testing in state/validation_test.go * Refactor errors to resemble existing conventions * Fix formatting * Extract common helper functions Having the tests littered with helper functions makes them less easily readable imho, so I've pulled them out into a separate file. This also makes it easier to see what helper functions are available during testing, so we minimize the chance of duplication when writing new tests. * Remove unused parameter * Remove unused parameters * Add field keys * Remove unused height constant * Fix typo * Fix incorrect return error * Add field keys * Use separate package for tests This refactors all of the state package's tests into a state_test package, so as to keep any usage of the state package's internal methods explicit. Any internal methods/constants used by tests are now explicitly exported in state/export_test.go * Refactor: extract helper function to make, validate, execute and commit a block * Rename state function to makeState * Remove redundant constant for number of validators * Refactor mock evidence registration into TestMain * Remove extraneous nVals variable * Replace function-level TODOs with file-level TODO and explanation * Remove extraneous comment * Fix linting issues brought up by GolangCI (pulled in from latest merge from develop)
5 years ago
state: add more tests for block validation (#3674) * Expose priv validators for use in testing * Generalize block header validation test past height 1 * Remove ineffectual assignment * Remove redundant SaveState call * Reorder comment for clarity * Use the block executor ApplyBlock function instead of implementing a stripped-down version of it * Remove commented-out code * Remove unnecessary test The required tests already appear to be implemented (implicitly) through the TestValidateBlockHeader test. * Allow for catching of specific error types during TestValidateBlockCommit * Make return error testable * Clean up and add TestValidateBlockCommit code * Fix formatting * Extract function to create a new mock test app * Update comment for clarity * Fix comment * Add skeleton code for evidence-related test * Allow for addressing priv val by address * Generalize test beyond a single validator * Generalize TestValidateBlockEvidence past first height * Reorder code to clearly separate tests and utility code * Use a common constant for stop height for testing in state/validation_test.go * Refactor errors to resemble existing conventions * Fix formatting * Extract common helper functions Having the tests littered with helper functions makes them less easily readable imho, so I've pulled them out into a separate file. This also makes it easier to see what helper functions are available during testing, so we minimize the chance of duplication when writing new tests. * Remove unused parameter * Remove unused parameters * Add field keys * Remove unused height constant * Fix typo * Fix incorrect return error * Add field keys * Use separate package for tests This refactors all of the state package's tests into a state_test package, so as to keep any usage of the state package's internal methods explicit. Any internal methods/constants used by tests are now explicitly exported in state/export_test.go * Refactor: extract helper function to make, validate, execute and commit a block * Rename state function to makeState * Remove redundant constant for number of validators * Refactor mock evidence registration into TestMain * Remove extraneous nVals variable * Replace function-level TODOs with file-level TODO and explanation * Remove extraneous comment * Fix linting issues brought up by GolangCI (pulled in from latest merge from develop)
5 years ago
state: add more tests for block validation (#3674) * Expose priv validators for use in testing * Generalize block header validation test past height 1 * Remove ineffectual assignment * Remove redundant SaveState call * Reorder comment for clarity * Use the block executor ApplyBlock function instead of implementing a stripped-down version of it * Remove commented-out code * Remove unnecessary test The required tests already appear to be implemented (implicitly) through the TestValidateBlockHeader test. * Allow for catching of specific error types during TestValidateBlockCommit * Make return error testable * Clean up and add TestValidateBlockCommit code * Fix formatting * Extract function to create a new mock test app * Update comment for clarity * Fix comment * Add skeleton code for evidence-related test * Allow for addressing priv val by address * Generalize test beyond a single validator * Generalize TestValidateBlockEvidence past first height * Reorder code to clearly separate tests and utility code * Use a common constant for stop height for testing in state/validation_test.go * Refactor errors to resemble existing conventions * Fix formatting * Extract common helper functions Having the tests littered with helper functions makes them less easily readable imho, so I've pulled them out into a separate file. This also makes it easier to see what helper functions are available during testing, so we minimize the chance of duplication when writing new tests. * Remove unused parameter * Remove unused parameters * Add field keys * Remove unused height constant * Fix typo * Fix incorrect return error * Add field keys * Use separate package for tests This refactors all of the state package's tests into a state_test package, so as to keep any usage of the state package's internal methods explicit. Any internal methods/constants used by tests are now explicitly exported in state/export_test.go * Refactor: extract helper function to make, validate, execute and commit a block * Rename state function to makeState * Remove redundant constant for number of validators * Refactor mock evidence registration into TestMain * Remove extraneous nVals variable * Replace function-level TODOs with file-level TODO and explanation * Remove extraneous comment * Fix linting issues brought up by GolangCI (pulled in from latest merge from develop)
5 years ago
state: add more tests for block validation (#3674) * Expose priv validators for use in testing * Generalize block header validation test past height 1 * Remove ineffectual assignment * Remove redundant SaveState call * Reorder comment for clarity * Use the block executor ApplyBlock function instead of implementing a stripped-down version of it * Remove commented-out code * Remove unnecessary test The required tests already appear to be implemented (implicitly) through the TestValidateBlockHeader test. * Allow for catching of specific error types during TestValidateBlockCommit * Make return error testable * Clean up and add TestValidateBlockCommit code * Fix formatting * Extract function to create a new mock test app * Update comment for clarity * Fix comment * Add skeleton code for evidence-related test * Allow for addressing priv val by address * Generalize test beyond a single validator * Generalize TestValidateBlockEvidence past first height * Reorder code to clearly separate tests and utility code * Use a common constant for stop height for testing in state/validation_test.go * Refactor errors to resemble existing conventions * Fix formatting * Extract common helper functions Having the tests littered with helper functions makes them less easily readable imho, so I've pulled them out into a separate file. This also makes it easier to see what helper functions are available during testing, so we minimize the chance of duplication when writing new tests. * Remove unused parameter * Remove unused parameters * Add field keys * Remove unused height constant * Fix typo * Fix incorrect return error * Add field keys * Use separate package for tests This refactors all of the state package's tests into a state_test package, so as to keep any usage of the state package's internal methods explicit. Any internal methods/constants used by tests are now explicitly exported in state/export_test.go * Refactor: extract helper function to make, validate, execute and commit a block * Rename state function to makeState * Remove redundant constant for number of validators * Refactor mock evidence registration into TestMain * Remove extraneous nVals variable * Replace function-level TODOs with file-level TODO and explanation * Remove extraneous comment * Fix linting issues brought up by GolangCI (pulled in from latest merge from develop)
5 years ago
state: add more tests for block validation (#3674) * Expose priv validators for use in testing * Generalize block header validation test past height 1 * Remove ineffectual assignment * Remove redundant SaveState call * Reorder comment for clarity * Use the block executor ApplyBlock function instead of implementing a stripped-down version of it * Remove commented-out code * Remove unnecessary test The required tests already appear to be implemented (implicitly) through the TestValidateBlockHeader test. * Allow for catching of specific error types during TestValidateBlockCommit * Make return error testable * Clean up and add TestValidateBlockCommit code * Fix formatting * Extract function to create a new mock test app * Update comment for clarity * Fix comment * Add skeleton code for evidence-related test * Allow for addressing priv val by address * Generalize test beyond a single validator * Generalize TestValidateBlockEvidence past first height * Reorder code to clearly separate tests and utility code * Use a common constant for stop height for testing in state/validation_test.go * Refactor errors to resemble existing conventions * Fix formatting * Extract common helper functions Having the tests littered with helper functions makes them less easily readable imho, so I've pulled them out into a separate file. This also makes it easier to see what helper functions are available during testing, so we minimize the chance of duplication when writing new tests. * Remove unused parameter * Remove unused parameters * Add field keys * Remove unused height constant * Fix typo * Fix incorrect return error * Add field keys * Use separate package for tests This refactors all of the state package's tests into a state_test package, so as to keep any usage of the state package's internal methods explicit. Any internal methods/constants used by tests are now explicitly exported in state/export_test.go * Refactor: extract helper function to make, validate, execute and commit a block * Rename state function to makeState * Remove redundant constant for number of validators * Refactor mock evidence registration into TestMain * Remove extraneous nVals variable * Replace function-level TODOs with file-level TODO and explanation * Remove extraneous comment * Fix linting issues brought up by GolangCI (pulled in from latest merge from develop)
5 years ago
state: add more tests for block validation (#3674) * Expose priv validators for use in testing * Generalize block header validation test past height 1 * Remove ineffectual assignment * Remove redundant SaveState call * Reorder comment for clarity * Use the block executor ApplyBlock function instead of implementing a stripped-down version of it * Remove commented-out code * Remove unnecessary test The required tests already appear to be implemented (implicitly) through the TestValidateBlockHeader test. * Allow for catching of specific error types during TestValidateBlockCommit * Make return error testable * Clean up and add TestValidateBlockCommit code * Fix formatting * Extract function to create a new mock test app * Update comment for clarity * Fix comment * Add skeleton code for evidence-related test * Allow for addressing priv val by address * Generalize test beyond a single validator * Generalize TestValidateBlockEvidence past first height * Reorder code to clearly separate tests and utility code * Use a common constant for stop height for testing in state/validation_test.go * Refactor errors to resemble existing conventions * Fix formatting * Extract common helper functions Having the tests littered with helper functions makes them less easily readable imho, so I've pulled them out into a separate file. This also makes it easier to see what helper functions are available during testing, so we minimize the chance of duplication when writing new tests. * Remove unused parameter * Remove unused parameters * Add field keys * Remove unused height constant * Fix typo * Fix incorrect return error * Add field keys * Use separate package for tests This refactors all of the state package's tests into a state_test package, so as to keep any usage of the state package's internal methods explicit. Any internal methods/constants used by tests are now explicitly exported in state/export_test.go * Refactor: extract helper function to make, validate, execute and commit a block * Rename state function to makeState * Remove redundant constant for number of validators * Refactor mock evidence registration into TestMain * Remove extraneous nVals variable * Replace function-level TODOs with file-level TODO and explanation * Remove extraneous comment * Fix linting issues brought up by GolangCI (pulled in from latest merge from develop)
5 years ago
  1. package state_test
  2. import (
  3. "bytes"
  4. "fmt"
  5. abci "github.com/tendermint/tendermint/abci/types"
  6. "github.com/tendermint/tendermint/crypto"
  7. "github.com/tendermint/tendermint/crypto/ed25519"
  8. "github.com/tendermint/tendermint/proxy"
  9. sm "github.com/tendermint/tendermint/state"
  10. "github.com/tendermint/tendermint/types"
  11. tmtime "github.com/tendermint/tendermint/types/time"
  12. dbm "github.com/tendermint/tm-db"
  13. )
  14. type paramsChangeTestCase struct {
  15. height int64
  16. params types.ConsensusParams
  17. }
  18. // always returns true if asked if any evidence was already committed.
  19. type mockEvPoolAlwaysCommitted struct{}
  20. func (m mockEvPoolAlwaysCommitted) PendingEvidence(int64) []types.Evidence { return nil }
  21. func (m mockEvPoolAlwaysCommitted) AddEvidence(types.Evidence) error { return nil }
  22. func (m mockEvPoolAlwaysCommitted) Update(*types.Block, sm.State) {}
  23. func (m mockEvPoolAlwaysCommitted) IsCommitted(types.Evidence) bool { return true }
  24. func newTestApp() proxy.AppConns {
  25. app := &testApp{}
  26. cc := proxy.NewLocalClientCreator(app)
  27. return proxy.NewAppConns(cc)
  28. }
  29. func makeAndCommitGoodBlock(
  30. state sm.State,
  31. height int64,
  32. lastCommit *types.Commit,
  33. proposerAddr []byte,
  34. blockExec *sm.BlockExecutor,
  35. privVals map[string]types.PrivValidator,
  36. evidence []types.Evidence) (sm.State, types.BlockID, *types.Commit, error) {
  37. // A good block passes
  38. state, blockID, err := makeAndApplyGoodBlock(state, height, lastCommit, proposerAddr, blockExec, evidence)
  39. if err != nil {
  40. return state, types.BlockID{}, nil, err
  41. }
  42. // Simulate a lastCommit for this block from all validators for the next height
  43. commit, err := makeValidCommit(height, blockID, state.Validators, privVals)
  44. if err != nil {
  45. return state, types.BlockID{}, nil, err
  46. }
  47. return state, blockID, commit, nil
  48. }
  49. func makeAndApplyGoodBlock(state sm.State, height int64, lastCommit *types.Commit, proposerAddr []byte,
  50. blockExec *sm.BlockExecutor, evidence []types.Evidence) (sm.State, types.BlockID, error) {
  51. block, _ := state.MakeBlock(height, makeTxs(height), lastCommit, evidence, proposerAddr)
  52. if err := blockExec.ValidateBlock(state, block); err != nil {
  53. return state, types.BlockID{}, err
  54. }
  55. blockID := types.BlockID{Hash: block.Hash(), PartsHeader: types.PartSetHeader{}}
  56. state, err := blockExec.ApplyBlock(state, blockID, block)
  57. if err != nil {
  58. return state, types.BlockID{}, err
  59. }
  60. return state, blockID, nil
  61. }
  62. func makeValidCommit(
  63. height int64,
  64. blockID types.BlockID,
  65. vals *types.ValidatorSet,
  66. privVals map[string]types.PrivValidator,
  67. ) (*types.Commit, error) {
  68. sigs := make([]*types.CommitSig, 0)
  69. for i := 0; i < vals.Size(); i++ {
  70. _, val := vals.GetByIndex(i)
  71. vote, err := types.MakeVote(height, blockID, vals, privVals[val.Address.String()], chainID)
  72. if err != nil {
  73. return nil, err
  74. }
  75. sigs = append(sigs, vote.CommitSig())
  76. }
  77. return types.NewCommit(blockID, sigs), nil
  78. }
  79. // make some bogus txs
  80. func makeTxs(height int64) (txs []types.Tx) {
  81. for i := 0; i < nTxsPerBlock; i++ {
  82. txs = append(txs, types.Tx([]byte{byte(height), byte(i)}))
  83. }
  84. return txs
  85. }
  86. func makeState(nVals, height int) (sm.State, dbm.DB, map[string]types.PrivValidator) {
  87. vals := make([]types.GenesisValidator, nVals)
  88. privVals := make(map[string]types.PrivValidator, nVals)
  89. for i := 0; i < nVals; i++ {
  90. secret := []byte(fmt.Sprintf("test%d", i))
  91. pk := ed25519.GenPrivKeyFromSecret(secret)
  92. valAddr := pk.PubKey().Address()
  93. vals[i] = types.GenesisValidator{
  94. Address: valAddr,
  95. PubKey: pk.PubKey(),
  96. Power: 1000,
  97. Name: fmt.Sprintf("test%d", i),
  98. }
  99. privVals[valAddr.String()] = types.NewMockPVWithParams(pk, false, false)
  100. }
  101. s, _ := sm.MakeGenesisState(&types.GenesisDoc{
  102. ChainID: chainID,
  103. Validators: vals,
  104. AppHash: nil,
  105. })
  106. stateDB := dbm.NewMemDB()
  107. sm.SaveState(stateDB, s)
  108. for i := 1; i < height; i++ {
  109. s.LastBlockHeight++
  110. s.LastValidators = s.Validators.Copy()
  111. sm.SaveState(stateDB, s)
  112. }
  113. return s, stateDB, privVals
  114. }
  115. func makeBlock(state sm.State, height int64) *types.Block {
  116. block, _ := state.MakeBlock(
  117. height,
  118. makeTxs(state.LastBlockHeight),
  119. new(types.Commit),
  120. nil,
  121. state.Validators.GetProposer().Address,
  122. )
  123. return block
  124. }
  125. func genValSet(size int) *types.ValidatorSet {
  126. vals := make([]*types.Validator, size)
  127. for i := 0; i < size; i++ {
  128. vals[i] = types.NewValidator(ed25519.GenPrivKey().PubKey(), 10)
  129. }
  130. return types.NewValidatorSet(vals)
  131. }
  132. func makeConsensusParams(
  133. blockBytes, blockGas int64,
  134. blockTimeIotaMs int64,
  135. evidenceAge int64,
  136. ) types.ConsensusParams {
  137. return types.ConsensusParams{
  138. Block: types.BlockParams{
  139. MaxBytes: blockBytes,
  140. MaxGas: blockGas,
  141. TimeIotaMs: blockTimeIotaMs,
  142. },
  143. Evidence: types.EvidenceParams{
  144. MaxAge: evidenceAge,
  145. },
  146. }
  147. }
  148. func makeHeaderPartsResponsesValPubKeyChange(
  149. state sm.State,
  150. pubkey crypto.PubKey,
  151. ) (types.Header, types.BlockID, *sm.ABCIResponses) {
  152. block := makeBlock(state, state.LastBlockHeight+1)
  153. abciResponses := &sm.ABCIResponses{
  154. EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil},
  155. }
  156. // If the pubkey is new, remove the old and add the new.
  157. _, val := state.NextValidators.GetByIndex(0)
  158. if !bytes.Equal(pubkey.Bytes(), val.PubKey.Bytes()) {
  159. abciResponses.EndBlock = &abci.ResponseEndBlock{
  160. ValidatorUpdates: []abci.ValidatorUpdate{
  161. types.TM2PB.NewValidatorUpdate(val.PubKey, 0),
  162. types.TM2PB.NewValidatorUpdate(pubkey, 10),
  163. },
  164. }
  165. }
  166. return block.Header, types.BlockID{Hash: block.Hash(), PartsHeader: types.PartSetHeader{}}, abciResponses
  167. }
  168. func makeHeaderPartsResponsesValPowerChange(
  169. state sm.State,
  170. power int64,
  171. ) (types.Header, types.BlockID, *sm.ABCIResponses) {
  172. block := makeBlock(state, state.LastBlockHeight+1)
  173. abciResponses := &sm.ABCIResponses{
  174. EndBlock: &abci.ResponseEndBlock{ValidatorUpdates: nil},
  175. }
  176. // If the pubkey is new, remove the old and add the new.
  177. _, val := state.NextValidators.GetByIndex(0)
  178. if val.VotingPower != power {
  179. abciResponses.EndBlock = &abci.ResponseEndBlock{
  180. ValidatorUpdates: []abci.ValidatorUpdate{
  181. types.TM2PB.NewValidatorUpdate(val.PubKey, power),
  182. },
  183. }
  184. }
  185. return block.Header, types.BlockID{Hash: block.Hash(), PartsHeader: types.PartSetHeader{}}, abciResponses
  186. }
  187. func makeHeaderPartsResponsesParams(
  188. state sm.State,
  189. params types.ConsensusParams,
  190. ) (types.Header, types.BlockID, *sm.ABCIResponses) {
  191. block := makeBlock(state, state.LastBlockHeight+1)
  192. abciResponses := &sm.ABCIResponses{
  193. EndBlock: &abci.ResponseEndBlock{ConsensusParamUpdates: types.TM2PB.ConsensusParams(&params)},
  194. }
  195. return block.Header, types.BlockID{Hash: block.Hash(), PartsHeader: types.PartSetHeader{}}, abciResponses
  196. }
  197. func randomGenesisDoc() *types.GenesisDoc {
  198. pubkey := ed25519.GenPrivKey().PubKey()
  199. return &types.GenesisDoc{
  200. GenesisTime: tmtime.Now(),
  201. ChainID: "abc",
  202. Validators: []types.GenesisValidator{
  203. {
  204. Address: pubkey.Address(),
  205. PubKey: pubkey,
  206. Power: 10,
  207. Name: "myval",
  208. },
  209. },
  210. ConsensusParams: types.DefaultConsensusParams(),
  211. }
  212. }
  213. //----------------------------------------------------------------------------
  214. type testApp struct {
  215. abci.BaseApplication
  216. CommitVotes []abci.VoteInfo
  217. ByzantineValidators []abci.Evidence
  218. ValidatorUpdates []abci.ValidatorUpdate
  219. }
  220. var _ abci.Application = (*testApp)(nil)
  221. func (app *testApp) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) {
  222. return abci.ResponseInfo{}
  223. }
  224. func (app *testApp) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlock {
  225. app.CommitVotes = req.LastCommitInfo.Votes
  226. app.ByzantineValidators = req.ByzantineValidators
  227. return abci.ResponseBeginBlock{}
  228. }
  229. func (app *testApp) EndBlock(req abci.RequestEndBlock) abci.ResponseEndBlock {
  230. return abci.ResponseEndBlock{ValidatorUpdates: app.ValidatorUpdates}
  231. }
  232. func (app *testApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx {
  233. return abci.ResponseDeliverTx{Events: []abci.Event{}}
  234. }
  235. func (app *testApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx {
  236. return abci.ResponseCheckTx{}
  237. }
  238. func (app *testApp) Commit() abci.ResponseCommit {
  239. return abci.ResponseCommit{}
  240. }
  241. func (app *testApp) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery) {
  242. return
  243. }