mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 13:55:17 +00:00
replace old mocks with new mock
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user