diff --git a/state/execution_test.go b/state/execution_test.go index 3af90f8a0..d8443100f 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -12,6 +12,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/crypto/secp256k1" + evmock "github.com/tendermint/tendermint/evidence/mock" "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/mock" "github.com/tendermint/tendermint/proxy" @@ -38,7 +39,7 @@ func TestApplyBlock(t *testing.T) { state, stateDB, _ := makeState(1, 1) blockExec := sm.NewBlockExecutor(stateDB, log.TestingLogger(), proxyApp.Consensus(), - mock.Mempool{}, sm.MockEvidencePool{}) + mock.Mempool{}, evmock.NewDefaultEvidencePool()) block := makeBlock(state, 1) blockID := types.BlockID{Hash: block.Hash(), PartsHeader: block.MakePartSet(testPartSize).Header()} @@ -334,7 +335,7 @@ func TestEndBlockValidatorUpdates(t *testing.T) { log.TestingLogger(), proxyApp.Consensus(), mock.Mempool{}, - sm.MockEvidencePool{}, + evmock.NewDefaultEvidencePool(), ) eventBus := types.NewEventBus() @@ -401,7 +402,7 @@ func TestEndBlockValidatorUpdatesResultingInEmptySet(t *testing.T) { log.TestingLogger(), proxyApp.Consensus(), mock.Mempool{}, - sm.MockEvidencePool{}, + evmock.NewDefaultEvidencePool(), ) block := makeBlock(state, 1) diff --git a/state/helpers_test.go b/state/helpers_test.go index c60a4b4dd..2805af63c 100644 --- a/state/helpers_test.go +++ b/state/helpers_test.go @@ -22,15 +22,6 @@ type paramsChangeTestCase struct { params types.ConsensusParams } -// always returns true if asked if any evidence was already committed. -type mockEvPoolAlwaysCommitted struct{} - -func (m mockEvPoolAlwaysCommitted) PendingEvidence(int64) []types.Evidence { return nil } -func (m mockEvPoolAlwaysCommitted) AddEvidence(types.Evidence) error { return nil } -func (m mockEvPoolAlwaysCommitted) Update(*types.Block, sm.State) {} -func (m mockEvPoolAlwaysCommitted) IsCommitted(types.Evidence) bool { return true } -func (m mockEvPoolAlwaysCommitted) IsPending(types.Evidence) bool { return false } - func newTestApp() proxy.AppConns { app := &testApp{} cc := proxy.NewLocalClientCreator(app) diff --git a/state/services.go b/state/services.go index b6fb33722..df6ce8f8f 100644 --- a/state/services.go +++ b/state/services.go @@ -45,12 +45,3 @@ type EvidencePool interface { IsCommitted(types.Evidence) bool IsPending(types.Evidence) bool } - -// MockEvidencePool is an empty implementation of EvidencePool, useful for testing. -type MockEvidencePool struct{} - -func (m MockEvidencePool) PendingEvidence(int64) []types.Evidence { return nil } -func (m MockEvidencePool) AddEvidence(types.Evidence) error { return nil } -func (m MockEvidencePool) Update(*types.Block, State) {} -func (m MockEvidencePool) IsCommitted(types.Evidence) bool { return false } -func (m MockEvidencePool) IsPending(types.Evidence) bool { return false } diff --git a/state/validation_test.go b/state/validation_test.go index 1be09c8dc..8cc7f44a7 100644 --- a/state/validation_test.go +++ b/state/validation_test.go @@ -29,7 +29,7 @@ func TestValidateBlockHeader(t *testing.T) { log.TestingLogger(), proxyApp.Consensus(), mock.Mempool{}, - sm.MockEvidencePool{}, + evmock.NewDefaultEvidencePool(), ) lastCommit := types.NewCommit(0, 0, types.BlockID{}, nil)