mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 22:44:24 +00:00
state.ApplyBlock takes evpool and calls MarkEvidenceAsCommitted
This commit is contained in:
+4
-1
@@ -327,7 +327,8 @@ func (s *State) validateBlock(b *types.Block) error {
|
||||
// commits it, and saves the block and state. It's the only function that needs to be called
|
||||
// from outside this package to process and commit an entire block.
|
||||
func (s *State) ApplyBlock(txEventPublisher types.TxEventPublisher, proxyAppConn proxy.AppConnConsensus,
|
||||
block *types.Block, partsHeader types.PartSetHeader, mempool types.Mempool) error {
|
||||
block *types.Block, partsHeader types.PartSetHeader,
|
||||
mempool types.Mempool, evpool types.EvidencePool) error {
|
||||
|
||||
abciResponses, err := s.ValExecBlock(txEventPublisher, proxyAppConn, block)
|
||||
if err != nil {
|
||||
@@ -355,6 +356,8 @@ func (s *State) ApplyBlock(txEventPublisher types.TxEventPublisher, proxyAppConn
|
||||
|
||||
fail.Fail() // XXX
|
||||
|
||||
evpool.MarkEvidenceAsCommitted(block.Evidence.Evidence)
|
||||
|
||||
// save the state and the validators
|
||||
s.Save()
|
||||
|
||||
|
||||
@@ -93,7 +93,10 @@ func TestApplyBlock(t *testing.T) {
|
||||
|
||||
block := makeBlock(state, 1)
|
||||
|
||||
err = state.ApplyBlock(types.NopEventBus{}, proxyApp.Consensus(), block, block.MakePartSet(testPartSize).Header(), types.MockMempool{})
|
||||
err = state.ApplyBlock(types.NopEventBus{}, proxyApp.Consensus(),
|
||||
block, block.MakePartSet(testPartSize).Header(),
|
||||
types.MockMempool{}, types.MockEvidencePool{})
|
||||
|
||||
require.Nil(t, err)
|
||||
|
||||
// TODO check state and mempool
|
||||
|
||||
Reference in New Issue
Block a user