github.com/Finschia/ostracon@v1.1.5/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/Finschia/ostracon/libs/pubsub/query" 11 12 types "github.com/Finschia/ostracon/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 var r1 error 26 if rf, ok := ret.Get(0).(func(int64) (bool, error)); ok { 27 return rf(height) 28 } 29 if rf, ok := ret.Get(0).(func(int64) bool); ok { 30 r0 = rf(height) 31 } else { 32 r0 = ret.Get(0).(bool) 33 } 34 35 if rf, ok := ret.Get(1).(func(int64) error); ok { 36 r1 = rf(height) 37 } else { 38 r1 = ret.Error(1) 39 } 40 41 return r0, r1 42 } 43 44 // Index provides a mock function with given fields: _a0 45 func (_m *BlockIndexer) Index(_a0 types.EventDataNewBlockHeader) error { 46 ret := _m.Called(_a0) 47 48 var r0 error 49 if rf, ok := ret.Get(0).(func(types.EventDataNewBlockHeader) error); ok { 50 r0 = rf(_a0) 51 } else { 52 r0 = ret.Error(0) 53 } 54 55 return r0 56 } 57 58 // Search provides a mock function with given fields: ctx, q 59 func (_m *BlockIndexer) Search(ctx context.Context, q *query.Query) ([]int64, error) { 60 ret := _m.Called(ctx, q) 61 62 var r0 []int64 63 var r1 error 64 if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]int64, error)); ok { 65 return rf(ctx, q) 66 } 67 if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []int64); ok { 68 r0 = rf(ctx, q) 69 } else { 70 if ret.Get(0) != nil { 71 r0 = ret.Get(0).([]int64) 72 } 73 } 74 75 if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { 76 r1 = rf(ctx, q) 77 } else { 78 r1 = ret.Error(1) 79 } 80 81 return r0, r1 82 } 83 84 // 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. 85 // The first argument is typically a *testing.T value. 86 func NewBlockIndexer(t interface { 87 mock.TestingT 88 Cleanup(func()) 89 }) *BlockIndexer { 90 mock := &BlockIndexer{} 91 mock.Mock.Test(t) 92 93 t.Cleanup(func() { mock.AssertExpectations(t) }) 94 95 return mock 96 }