(t *testing.T)
| 33 | ) |
| 34 | |
| 35 | func TestApplyBlock(t *testing.T) { |
| 36 | app := &testApp{} |
| 37 | cc := proxy.NewLocalClientCreator(app) |
| 38 | proxyApp := proxy.NewAppConns(cc) |
| 39 | err := proxyApp.Start() |
| 40 | require.Nil(t, err) |
| 41 | defer proxyApp.Stop() //nolint:errcheck // ignore for tests |
| 42 | |
| 43 | state, stateDB, _ := makeState(1, 1) |
| 44 | stateStore := sm.NewStore(stateDB, sm.StoreOptions{ |
| 45 | DiscardABCIResponses: false, |
| 46 | }) |
| 47 | |
| 48 | blockExec := sm.NewBlockExecutor(stateStore, log.TestingLogger(), proxyApp.Consensus(), |
| 49 | mmock.Mempool{}, sm.EmptyEvidencePool{}) |
| 50 | |
| 51 | block := makeBlock(state, 1) |
| 52 | blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()} |
| 53 | |
| 54 | state, retainHeight, err := blockExec.ApplyBlock(state, blockID, block) |
| 55 | require.Nil(t, err) |
| 56 | assert.EqualValues(t, retainHeight, 1) |
| 57 | |
| 58 | // TODO check state and mempool |
| 59 | assert.EqualValues(t, 1, state.Version.Consensus.App, "App version wasn't updated") |
| 60 | } |
| 61 | |
| 62 | // TestBeginBlockValidators ensures we send absent validators list. |
| 63 | func TestBeginBlockValidators(t *testing.T) { |
nothing calls this directly
no test coverage detected