github.com/badrootd/celestia-core@v0.0.0-20240305091328-aa4207a4b25d/state/indexer/mocks/block_indexer.go (about) 1 // Code generated by mockery. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 mock "github.com/stretchr/testify/mock" 9 10 query "github.com/badrootd/celestia-core/libs/pubsub/query" 11 12 types "github.com/badrootd/celestia-core/types" 13 ) 14 15 // BlockIndexer is an autogenerated mock type for the BlockIndexer type 16 type BlockIndexer struct { 17 mock.Mock 18 } 19 20 // Has provides a mock function with given fields: height 21 func (_m *BlockIndexer) Has(height int64) (bool, error) { 22 ret := _m.Called(height) 23 24 var r0 bool 25 if rf, ok := ret.Get(0).(func(int64) bool); ok { 26 r0 = rf(height) 27 } else { 28 r0 = ret.Get(0).(bool) 29 } 30 31 var r1 error 32 if rf, ok := ret.Get(1).(func(int64) error); ok { 33 r1 = rf(height) 34 } else { 35 r1 = ret.Error(1) 36 } 37 38 return r0, r1 39 } 40 41 // Index provides a mock function with given fields: _a0 42 func (_m *BlockIndexer) Index(_a0 types.EventDataNewBlockHeader) error { 43 ret := _m.Called(_a0) 44 45 var r0 error 46 if rf, ok := ret.Get(0).(func(types.EventDataNewBlockHeader) error); ok { 47 r0 = rf(_a0) 48 } else { 49 r0 = ret.Error(0) 50 } 51 52 return r0 53 } 54 55 // Search provides a mock function with given fields: ctx, q 56 func (_m *BlockIndexer) Search(ctx context.Context, q *query.Query) ([]int64, error) { 57 ret := _m.Called(ctx, q) 58 59 var r0 []int64 60 if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []int64); ok { 61 r0 = rf(ctx, q) 62 } else { 63 if ret.Get(0) != nil { 64 r0 = ret.Get(0).([]int64) 65 } 66 } 67 68 var r1 error 69 if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { 70 r1 = rf(ctx, q) 71 } else { 72 r1 = ret.Error(1) 73 } 74 75 return r0, r1 76 } 77 78 type mockConstructorTestingTNewBlockIndexer interface { 79 mock.TestingT 80 Cleanup(func()) 81 } 82 83 // NewBlockIndexer creates a new instance of BlockIndexer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 84 func NewBlockIndexer(t mockConstructorTestingTNewBlockIndexer) *BlockIndexer { 85 mock := &BlockIndexer{} 86 mock.Mock.Test(t) 87 88 t.Cleanup(func() { mock.AssertExpectations(t) }) 89 90 return mock 91 }