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