github.com/Oyster-zx/tendermint@v0.34.24-fork/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 mock "github.com/stretchr/testify/mock" 9 10 query "github.com/tendermint/tendermint/libs/pubsub/query" 11 12 txindex "github.com/tendermint/tendermint/state/txindex" 13 14 types "github.com/tendermint/tendermint/abci/types" 15 ) 16 17 // TxIndexer is an autogenerated mock type for the TxIndexer type 18 type TxIndexer struct { 19 mock.Mock 20 } 21 22 // AddBatch provides a mock function with given fields: b 23 func (_m *TxIndexer) AddBatch(b *txindex.Batch) error { 24 ret := _m.Called(b) 25 26 var r0 error 27 if rf, ok := ret.Get(0).(func(*txindex.Batch) error); ok { 28 r0 = rf(b) 29 } else { 30 r0 = ret.Error(0) 31 } 32 33 return r0 34 } 35 36 // Get provides a mock function with given fields: hash 37 func (_m *TxIndexer) Get(hash []byte) (*types.TxResult, error) { 38 ret := _m.Called(hash) 39 40 var r0 *types.TxResult 41 if rf, ok := ret.Get(0).(func([]byte) *types.TxResult); ok { 42 r0 = rf(hash) 43 } else { 44 if ret.Get(0) != nil { 45 r0 = ret.Get(0).(*types.TxResult) 46 } 47 } 48 49 var r1 error 50 if rf, ok := ret.Get(1).(func([]byte) error); ok { 51 r1 = rf(hash) 52 } else { 53 r1 = ret.Error(1) 54 } 55 56 return r0, r1 57 } 58 59 // Index provides a mock function with given fields: result 60 func (_m *TxIndexer) Index(result *types.TxResult) error { 61 ret := _m.Called(result) 62 63 var r0 error 64 if rf, ok := ret.Get(0).(func(*types.TxResult) error); ok { 65 r0 = rf(result) 66 } else { 67 r0 = ret.Error(0) 68 } 69 70 return r0 71 } 72 73 // Search provides a mock function with given fields: ctx, q 74 func (_m *TxIndexer) Search(ctx context.Context, q *query.Query) ([]*types.TxResult, error) { 75 ret := _m.Called(ctx, q) 76 77 var r0 []*types.TxResult 78 if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []*types.TxResult); ok { 79 r0 = rf(ctx, q) 80 } else { 81 if ret.Get(0) != nil { 82 r0 = ret.Get(0).([]*types.TxResult) 83 } 84 } 85 86 var r1 error 87 if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { 88 r1 = rf(ctx, q) 89 } else { 90 r1 = ret.Error(1) 91 } 92 93 return r0, r1 94 } 95 96 type mockConstructorTestingTNewTxIndexer interface { 97 mock.TestingT 98 Cleanup(func()) 99 } 100 101 // 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. 102 func NewTxIndexer(t mockConstructorTestingTNewTxIndexer) *TxIndexer { 103 mock := &TxIndexer{} 104 mock.Mock.Test(t) 105 106 t.Cleanup(func() { mock.AssertExpectations(t) }) 107 108 return mock 109 }