From a988cefe5d7ded73d242b3de9417e81cfe021429 Mon Sep 17 00:00:00 2001 From: "M. J. Fromberger" Date: Wed, 25 May 2022 08:48:56 -0700 Subject: [PATCH] Update generated mocks after #8607. (#8612) --- abci/client/mocks/client.go | 11 +++++++---- abci/types/mocks/application.go | 11 +++++++---- internal/consensus/mocks/cons_sync_reactor.go | 11 +++++++---- internal/evidence/mocks/block_store.go | 12 +++++++----- internal/mempool/mocks/mempool.go | 11 +++++++---- internal/p2p/mocks/connection.go | 11 +++++++---- internal/p2p/mocks/transport.go | 11 +++++++---- internal/state/indexer/mocks/event_sink.go | 11 +++++++---- internal/state/mocks/block_store.go | 11 +++++++---- internal/state/mocks/evidence_pool.go | 11 +++++++---- internal/state/mocks/store.go | 11 +++++++---- internal/statesync/mocks/state_provider.go | 11 +++++++---- libs/time/mocks/source.go | 13 ++++++++----- light/provider/mocks/provider.go | 11 +++++++---- light/rpc/mocks/light_client.go | 11 +++++++---- rpc/client/mocks/client.go | 11 +++++++---- 16 files changed, 113 insertions(+), 66 deletions(-) diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index e5f2898f3..add3c2ae9 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -4,10 +4,8 @@ package mocks import ( context "context" - testing "testing" mock "github.com/stretchr/testify/mock" - types "github.com/tendermint/tendermint/abci/types" ) @@ -422,8 +420,13 @@ func (_m *Client) Wait() { _m.Called() } -// NewClient creates a new instance of Client. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewClient(t testing.TB) *Client { +type NewClientT interface { + mock.TestingT + Cleanup(func()) +} + +// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewClient(t NewClientT) *Client { mock := &Client{} mock.Mock.Test(t) diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index 2d35c481f..62cf92905 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -4,10 +4,8 @@ package mocks import ( context "context" - testing "testing" mock "github.com/stretchr/testify/mock" - types "github.com/tendermint/tendermint/abci/types" ) @@ -338,8 +336,13 @@ func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *types.Reque return r0, r1 } -// NewApplication creates a new instance of Application. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewApplication(t testing.TB) *Application { +type NewApplicationT interface { + mock.TestingT + Cleanup(func()) +} + +// NewApplication creates a new instance of Application. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewApplication(t NewApplicationT) *Application { mock := &Application{} mock.Mock.Test(t) diff --git a/internal/consensus/mocks/cons_sync_reactor.go b/internal/consensus/mocks/cons_sync_reactor.go index f904e9129..2c694742b 100644 --- a/internal/consensus/mocks/cons_sync_reactor.go +++ b/internal/consensus/mocks/cons_sync_reactor.go @@ -3,8 +3,6 @@ package mocks import ( - testing "testing" - mock "github.com/stretchr/testify/mock" state "github.com/tendermint/tendermint/internal/state" ) @@ -29,8 +27,13 @@ func (_m *ConsSyncReactor) SwitchToConsensus(_a0 state.State, _a1 bool) { _m.Called(_a0, _a1) } -// NewConsSyncReactor creates a new instance of ConsSyncReactor. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewConsSyncReactor(t testing.TB) *ConsSyncReactor { +type NewConsSyncReactorT interface { + mock.TestingT + Cleanup(func()) +} + +// NewConsSyncReactor creates a new instance of ConsSyncReactor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewConsSyncReactor(t NewConsSyncReactorT) *ConsSyncReactor { mock := &ConsSyncReactor{} mock.Mock.Test(t) diff --git a/internal/evidence/mocks/block_store.go b/internal/evidence/mocks/block_store.go index e45b281b9..b0c67ff87 100644 --- a/internal/evidence/mocks/block_store.go +++ b/internal/evidence/mocks/block_store.go @@ -3,10 +3,7 @@ package mocks import ( - testing "testing" - mock "github.com/stretchr/testify/mock" - types "github.com/tendermint/tendermint/types" ) @@ -61,8 +58,13 @@ func (_m *BlockStore) LoadBlockMeta(height int64) *types.BlockMeta { return r0 } -// NewBlockStore creates a new instance of BlockStore. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewBlockStore(t testing.TB) *BlockStore { +type NewBlockStoreT interface { + mock.TestingT + Cleanup(func()) +} + +// NewBlockStore creates a new instance of BlockStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewBlockStore(t NewBlockStoreT) *BlockStore { mock := &BlockStore{} mock.Mock.Test(t) diff --git a/internal/mempool/mocks/mempool.go b/internal/mempool/mocks/mempool.go index b82d7d63e..454ca602f 100644 --- a/internal/mempool/mocks/mempool.go +++ b/internal/mempool/mocks/mempool.go @@ -11,8 +11,6 @@ import ( mock "github.com/stretchr/testify/mock" - testing "testing" - types "github.com/tendermint/tendermint/types" ) @@ -173,8 +171,13 @@ func (_m *Mempool) Update(ctx context.Context, blockHeight int64, blockTxs types return r0 } -// NewMempool creates a new instance of Mempool. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewMempool(t testing.TB) *Mempool { +type NewMempoolT interface { + mock.TestingT + Cleanup(func()) +} + +// NewMempool creates a new instance of Mempool. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewMempool(t NewMempoolT) *Mempool { mock := &Mempool{} mock.Mock.Test(t) diff --git a/internal/p2p/mocks/connection.go b/internal/p2p/mocks/connection.go index 73b6cfc3b..766bbf657 100644 --- a/internal/p2p/mocks/connection.go +++ b/internal/p2p/mocks/connection.go @@ -13,8 +13,6 @@ import ( p2p "github.com/tendermint/tendermint/internal/p2p" - testing "testing" - types "github.com/tendermint/tendermint/types" ) @@ -153,8 +151,13 @@ func (_m *Connection) String() string { return r0 } -// NewConnection creates a new instance of Connection. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewConnection(t testing.TB) *Connection { +type NewConnectionT interface { + mock.TestingT + Cleanup(func()) +} + +// NewConnection creates a new instance of Connection. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewConnection(t NewConnectionT) *Connection { mock := &Connection{} mock.Mock.Test(t) diff --git a/internal/p2p/mocks/transport.go b/internal/p2p/mocks/transport.go index 34ebec20e..436c961c3 100644 --- a/internal/p2p/mocks/transport.go +++ b/internal/p2p/mocks/transport.go @@ -10,8 +10,6 @@ import ( mock "github.com/stretchr/testify/mock" p2p "github.com/tendermint/tendermint/internal/p2p" - - testing "testing" ) // Transport is an autogenerated mock type for the Transport type @@ -151,8 +149,13 @@ func (_m *Transport) String() string { return r0 } -// NewTransport creates a new instance of Transport. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewTransport(t testing.TB) *Transport { +type NewTransportT interface { + mock.TestingT + Cleanup(func()) +} + +// NewTransport creates a new instance of Transport. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewTransport(t NewTransportT) *Transport { mock := &Transport{} mock.Mock.Test(t) diff --git a/internal/state/indexer/mocks/event_sink.go b/internal/state/indexer/mocks/event_sink.go index decf551ab..a7221a087 100644 --- a/internal/state/indexer/mocks/event_sink.go +++ b/internal/state/indexer/mocks/event_sink.go @@ -12,8 +12,6 @@ import ( tenderminttypes "github.com/tendermint/tendermint/types" - testing "testing" - types "github.com/tendermint/tendermint/abci/types" ) @@ -168,8 +166,13 @@ func (_m *EventSink) Type() indexer.EventSinkType { return r0 } -// NewEventSink creates a new instance of EventSink. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewEventSink(t testing.TB) *EventSink { +type NewEventSinkT interface { + mock.TestingT + Cleanup(func()) +} + +// NewEventSink creates a new instance of EventSink. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewEventSink(t NewEventSinkT) *EventSink { mock := &EventSink{} mock.Mock.Test(t) diff --git a/internal/state/mocks/block_store.go b/internal/state/mocks/block_store.go index 58fc640fc..3b8eca45e 100644 --- a/internal/state/mocks/block_store.go +++ b/internal/state/mocks/block_store.go @@ -5,8 +5,6 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - testing "testing" - types "github.com/tendermint/tendermint/types" ) @@ -232,8 +230,13 @@ func (_m *BlockStore) Size() int64 { return r0 } -// NewBlockStore creates a new instance of BlockStore. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewBlockStore(t testing.TB) *BlockStore { +type NewBlockStoreT interface { + mock.TestingT + Cleanup(func()) +} + +// NewBlockStore creates a new instance of BlockStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewBlockStore(t NewBlockStoreT) *BlockStore { mock := &BlockStore{} mock.Mock.Test(t) diff --git a/internal/state/mocks/evidence_pool.go b/internal/state/mocks/evidence_pool.go index 49633269b..98abb4776 100644 --- a/internal/state/mocks/evidence_pool.go +++ b/internal/state/mocks/evidence_pool.go @@ -8,8 +8,6 @@ import ( mock "github.com/stretchr/testify/mock" state "github.com/tendermint/tendermint/internal/state" - testing "testing" - types "github.com/tendermint/tendermint/types" ) @@ -74,8 +72,13 @@ func (_m *EvidencePool) Update(_a0 context.Context, _a1 state.State, _a2 types.E _m.Called(_a0, _a1, _a2) } -// NewEvidencePool creates a new instance of EvidencePool. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewEvidencePool(t testing.TB) *EvidencePool { +type NewEvidencePoolT interface { + mock.TestingT + Cleanup(func()) +} + +// NewEvidencePool creates a new instance of EvidencePool. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewEvidencePool(t NewEvidencePoolT) *EvidencePool { mock := &EvidencePool{} mock.Mock.Test(t) diff --git a/internal/state/mocks/store.go b/internal/state/mocks/store.go index 9b41f3c1b..d08ba4c9e 100644 --- a/internal/state/mocks/store.go +++ b/internal/state/mocks/store.go @@ -7,8 +7,6 @@ import ( state "github.com/tendermint/tendermint/internal/state" tendermintstate "github.com/tendermint/tendermint/proto/tendermint/state" - testing "testing" - types "github.com/tendermint/tendermint/types" ) @@ -189,8 +187,13 @@ func (_m *Store) SaveValidatorSets(_a0 int64, _a1 int64, _a2 *types.ValidatorSet return r0 } -// NewStore creates a new instance of Store. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewStore(t testing.TB) *Store { +type NewStoreT interface { + mock.TestingT + Cleanup(func()) +} + +// NewStore creates a new instance of Store. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewStore(t NewStoreT) *Store { mock := &Store{} mock.Mock.Test(t) diff --git a/internal/statesync/mocks/state_provider.go b/internal/statesync/mocks/state_provider.go index 582ebcd9c..17ddb54ac 100644 --- a/internal/statesync/mocks/state_provider.go +++ b/internal/statesync/mocks/state_provider.go @@ -8,8 +8,6 @@ import ( mock "github.com/stretchr/testify/mock" state "github.com/tendermint/tendermint/internal/state" - testing "testing" - types "github.com/tendermint/tendermint/types" ) @@ -85,8 +83,13 @@ func (_m *StateProvider) State(ctx context.Context, height uint64) (state.State, return r0, r1 } -// NewStateProvider creates a new instance of StateProvider. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewStateProvider(t testing.TB) *StateProvider { +type NewStateProviderT interface { + mock.TestingT + Cleanup(func()) +} + +// NewStateProvider creates a new instance of StateProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewStateProvider(t NewStateProviderT) *StateProvider { mock := &StateProvider{} mock.Mock.Test(t) diff --git a/libs/time/mocks/source.go b/libs/time/mocks/source.go index 7878d86f5..386d20c45 100644 --- a/libs/time/mocks/source.go +++ b/libs/time/mocks/source.go @@ -3,11 +3,9 @@ package mocks import ( - testing "testing" + time "time" mock "github.com/stretchr/testify/mock" - - time "time" ) // Source is an autogenerated mock type for the Source type @@ -29,8 +27,13 @@ func (_m *Source) Now() time.Time { return r0 } -// NewSource creates a new instance of Source. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewSource(t testing.TB) *Source { +type NewSourceT interface { + mock.TestingT + Cleanup(func()) +} + +// NewSource creates a new instance of Source. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewSource(t NewSourceT) *Source { mock := &Source{} mock.Mock.Test(t) diff --git a/light/provider/mocks/provider.go b/light/provider/mocks/provider.go index e136046f9..af2e9c930 100644 --- a/light/provider/mocks/provider.go +++ b/light/provider/mocks/provider.go @@ -7,8 +7,6 @@ import ( mock "github.com/stretchr/testify/mock" - testing "testing" - types "github.com/tendermint/tendermint/types" ) @@ -68,8 +66,13 @@ func (_m *Provider) ReportEvidence(_a0 context.Context, _a1 types.Evidence) erro return r0 } -// NewProvider creates a new instance of Provider. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewProvider(t testing.TB) *Provider { +type NewProviderT interface { + mock.TestingT + Cleanup(func()) +} + +// NewProvider creates a new instance of Provider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewProvider(t NewProviderT) *Provider { mock := &Provider{} mock.Mock.Test(t) diff --git a/light/rpc/mocks/light_client.go b/light/rpc/mocks/light_client.go index ea6d6a2d4..4130c9575 100644 --- a/light/rpc/mocks/light_client.go +++ b/light/rpc/mocks/light_client.go @@ -7,8 +7,6 @@ import ( mock "github.com/stretchr/testify/mock" - testing "testing" - time "time" types "github.com/tendermint/tendermint/types" @@ -118,8 +116,13 @@ func (_m *LightClient) VerifyLightBlockAtHeight(ctx context.Context, height int6 return r0, r1 } -// NewLightClient creates a new instance of LightClient. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewLightClient(t testing.TB) *LightClient { +type NewLightClientT interface { + mock.TestingT + Cleanup(func()) +} + +// NewLightClient creates a new instance of LightClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewLightClient(t NewLightClientT) *LightClient { mock := &LightClient{} mock.Mock.Test(t) diff --git a/rpc/client/mocks/client.go b/rpc/client/mocks/client.go index 9a286eaf2..0bc478fc3 100644 --- a/rpc/client/mocks/client.go +++ b/rpc/client/mocks/client.go @@ -12,8 +12,6 @@ import ( mock "github.com/stretchr/testify/mock" - testing "testing" - types "github.com/tendermint/tendermint/types" ) @@ -798,8 +796,13 @@ func (_m *Client) Validators(ctx context.Context, height *int64, page *int, perP return r0, r1 } -// NewClient creates a new instance of Client. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations. -func NewClient(t testing.TB) *Client { +type NewClientT interface { + mock.TestingT + Cleanup(func()) +} + +// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewClient(t NewClientT) *Client { mock := &Client{} mock.Mock.Test(t)