From b6f9c60f206702ef78c2f233151261a6c5f608f1 Mon Sep 17 00:00:00 2001 From: Sergi Rene Date: Thu, 21 Nov 2024 22:16:48 +0100 Subject: [PATCH] mocks --- .../dymint/p2p/mock_GetProposerI.go | 82 ----------- .../dymint/p2p/mock_StateGetter.go | 127 ++++++++++++++++++ 2 files changed, 127 insertions(+), 82 deletions(-) delete mode 100644 mocks/github.com/dymensionxyz/dymint/p2p/mock_GetProposerI.go create mode 100644 mocks/github.com/dymensionxyz/dymint/p2p/mock_StateGetter.go diff --git a/mocks/github.com/dymensionxyz/dymint/p2p/mock_GetProposerI.go b/mocks/github.com/dymensionxyz/dymint/p2p/mock_GetProposerI.go deleted file mode 100644 index 22bf320ac..000000000 --- a/mocks/github.com/dymensionxyz/dymint/p2p/mock_GetProposerI.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by mockery v2.43.0. DO NOT EDIT. - -package p2p - -import ( - mock "github.com/stretchr/testify/mock" - crypto "github.com/tendermint/tendermint/crypto" -) - -// MockGetProposerI is an autogenerated mock type for the GetProposerI type -type MockGetProposerI struct { - mock.Mock -} - -type MockGetProposerI_Expecter struct { - mock *mock.Mock -} - -func (_m *MockGetProposerI) EXPECT() *MockGetProposerI_Expecter { - return &MockGetProposerI_Expecter{mock: &_m.Mock} -} - -// GetProposerPubKey provides a mock function with given fields: -func (_m *MockGetProposerI) GetProposerPubKey() crypto.PubKey { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetProposerPubKey") - } - - var r0 crypto.PubKey - if rf, ok := ret.Get(0).(func() crypto.PubKey); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(crypto.PubKey) - } - } - - return r0 -} - -// MockGetProposerI_GetProposerPubKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerPubKey' -type MockGetProposerI_GetProposerPubKey_Call struct { - *mock.Call -} - -// GetProposerPubKey is a helper method to define mock.On call -func (_e *MockGetProposerI_Expecter) GetProposerPubKey() *MockGetProposerI_GetProposerPubKey_Call { - return &MockGetProposerI_GetProposerPubKey_Call{Call: _e.mock.On("GetProposerPubKey")} -} - -func (_c *MockGetProposerI_GetProposerPubKey_Call) Run(run func()) *MockGetProposerI_GetProposerPubKey_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockGetProposerI_GetProposerPubKey_Call) Return(_a0 crypto.PubKey) *MockGetProposerI_GetProposerPubKey_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockGetProposerI_GetProposerPubKey_Call) RunAndReturn(run func() crypto.PubKey) *MockGetProposerI_GetProposerPubKey_Call { - _c.Call.Return(run) - return _c -} - -// NewMockGetProposerI creates a new instance of MockGetProposerI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMockGetProposerI(t interface { - mock.TestingT - Cleanup(func()) -}) *MockGetProposerI { - mock := &MockGetProposerI{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/github.com/dymensionxyz/dymint/p2p/mock_StateGetter.go b/mocks/github.com/dymensionxyz/dymint/p2p/mock_StateGetter.go new file mode 100644 index 000000000..4377638cb --- /dev/null +++ b/mocks/github.com/dymensionxyz/dymint/p2p/mock_StateGetter.go @@ -0,0 +1,127 @@ +// Code generated by mockery v2.42.3. DO NOT EDIT. + +package p2p + +import ( + mock "github.com/stretchr/testify/mock" + crypto "github.com/tendermint/tendermint/crypto" +) + +// MockStateGetter is an autogenerated mock type for the StateGetter type +type MockStateGetter struct { + mock.Mock +} + +type MockStateGetter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockStateGetter) EXPECT() *MockStateGetter_Expecter { + return &MockStateGetter_Expecter{mock: &_m.Mock} +} + +// GetProposerPubKey provides a mock function with given fields: +func (_m *MockStateGetter) GetProposerPubKey() crypto.PubKey { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetProposerPubKey") + } + + var r0 crypto.PubKey + if rf, ok := ret.Get(0).(func() crypto.PubKey); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(crypto.PubKey) + } + } + + return r0 +} + +// MockStateGetter_GetProposerPubKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerPubKey' +type MockStateGetter_GetProposerPubKey_Call struct { + *mock.Call +} + +// GetProposerPubKey is a helper method to define mock.On call +func (_e *MockStateGetter_Expecter) GetProposerPubKey() *MockStateGetter_GetProposerPubKey_Call { + return &MockStateGetter_GetProposerPubKey_Call{Call: _e.mock.On("GetProposerPubKey")} +} + +func (_c *MockStateGetter_GetProposerPubKey_Call) Run(run func()) *MockStateGetter_GetProposerPubKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockStateGetter_GetProposerPubKey_Call) Return(_a0 crypto.PubKey) *MockStateGetter_GetProposerPubKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockStateGetter_GetProposerPubKey_Call) RunAndReturn(run func() crypto.PubKey) *MockStateGetter_GetProposerPubKey_Call { + _c.Call.Return(run) + return _c +} + +// GetRevision provides a mock function with given fields: +func (_m *MockStateGetter) GetRevision() uint64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetRevision") + } + + var r0 uint64 + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + return r0 +} + +// MockStateGetter_GetRevision_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRevision' +type MockStateGetter_GetRevision_Call struct { + *mock.Call +} + +// GetRevision is a helper method to define mock.On call +func (_e *MockStateGetter_Expecter) GetRevision() *MockStateGetter_GetRevision_Call { + return &MockStateGetter_GetRevision_Call{Call: _e.mock.On("GetRevision")} +} + +func (_c *MockStateGetter_GetRevision_Call) Run(run func()) *MockStateGetter_GetRevision_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockStateGetter_GetRevision_Call) Return(_a0 uint64) *MockStateGetter_GetRevision_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockStateGetter_GetRevision_Call) RunAndReturn(run func() uint64) *MockStateGetter_GetRevision_Call { + _c.Call.Return(run) + return _c +} + +// NewMockStateGetter creates a new instance of MockStateGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockStateGetter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockStateGetter { + mock := &MockStateGetter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}