github.com/aakash4dev/cometbft@v0.38.2/state/txindex/mocks/tx_indexer.go (about) 1 // Code generated by mockery. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 log "github.com/aakash4dev/cometbft/libs/log" 9 mock "github.com/stretchr/testify/mock" 10 11 query "github.com/aakash4dev/cometbft/libs/pubsub/query" 12 13 txindex "github.com/aakash4dev/cometbft/state/txindex" 14 15 types "github.com/aakash4dev/cometbft/abci/types" 16 ) 17 18 // TxIndexer is an autogenerated mock type for the TxIndexer type 19 type TxIndexer struct { 20 mock.Mock 21 } 22 23 // AddBatch provides a mock function with given fields: b 24 func (_m *TxIndexer) AddBatch(b *txindex.Batch) error { 25 ret := _m.Called(b) 26 27 var r0 error 28 if rf, ok := ret.Get(0).(func(*txindex.Batch) error); ok { 29 r0 = rf(b) 30 } else { 31 r0 = ret.Error(0) 32 } 33 34 return r0 35 } 36 37 // Get provides a mock function with given fields: hash 38 func (_m *TxIndexer) Get(hash []byte) (*types.TxResult, error) { 39 ret := _m.Called(hash) 40 41 var r0 *types.TxResult 42 var r1 error 43 if rf, ok := ret.Get(0).(func([]byte) (*types.TxResult, error)); ok { 44 return rf(hash) 45 } 46 if rf, ok := ret.Get(0).(func([]byte) *types.TxResult); ok { 47 r0 = rf(hash) 48 } else { 49 if ret.Get(0) != nil { 50 r0 = ret.Get(0).(*types.TxResult) 51 } 52 } 53 54 if rf, ok := ret.Get(1).(func([]byte) error); ok { 55 r1 = rf(hash) 56 } else { 57 r1 = ret.Error(1) 58 } 59 60 return r0, r1 61 } 62 63 // Index provides a mock function with given fields: result 64 func (_m *TxIndexer) Index(result *types.TxResult) error { 65 ret := _m.Called(result) 66 67 var r0 error 68 if rf, ok := ret.Get(0).(func(*types.TxResult) error); ok { 69 r0 = rf(result) 70 } else { 71 r0 = ret.Error(0) 72 } 73 74 return r0 75 } 76 77 // Search provides a mock function with given fields: ctx, q 78 func (_m *TxIndexer) Search(ctx context.Context, q *query.Query) ([]*types.TxResult, error) { 79 ret := _m.Called(ctx, q) 80 81 var r0 []*types.TxResult 82 var r1 error 83 if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]*types.TxResult, error)); ok { 84 return rf(ctx, q) 85 } 86 if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []*types.TxResult); ok { 87 r0 = rf(ctx, q) 88 } else { 89 if ret.Get(0) != nil { 90 r0 = ret.Get(0).([]*types.TxResult) 91 } 92 } 93 94 if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { 95 r1 = rf(ctx, q) 96 } else { 97 r1 = ret.Error(1) 98 } 99 100 return r0, r1 101 } 102 103 // SetLogger provides a mock function with given fields: l 104 func (_m *TxIndexer) SetLogger(l log.Logger) { 105 _m.Called(l) 106 } 107 108 // NewTxIndexer creates a new instance of TxIndexer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 109 // The first argument is typically a *testing.T value. 110 func NewTxIndexer(t interface { 111 mock.TestingT 112 Cleanup(func()) 113 }) *TxIndexer { 114 mock := &TxIndexer{} 115 mock.Mock.Test(t) 116 117 t.Cleanup(func() { mock.AssertExpectations(t) }) 118 119 return mock 120 }