github.com/Finschia/ostracon@v1.1.5/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/Finschia/ostracon/libs/pubsub/query"
     9  	mock "github.com/stretchr/testify/mock"
    10  
    11  	txindex "github.com/Finschia/ostracon/state/txindex"
    12  
    13  	types "github.com/tendermint/tendermint/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  	var r1 error
    41  	if rf, ok := ret.Get(0).(func([]byte) (*types.TxResult, error)); ok {
    42  		return rf(hash)
    43  	}
    44  	if rf, ok := ret.Get(0).(func([]byte) *types.TxResult); ok {
    45  		r0 = rf(hash)
    46  	} else {
    47  		if ret.Get(0) != nil {
    48  			r0 = ret.Get(0).(*types.TxResult)
    49  		}
    50  	}
    51  
    52  	if rf, ok := ret.Get(1).(func([]byte) error); ok {
    53  		r1 = rf(hash)
    54  	} else {
    55  		r1 = ret.Error(1)
    56  	}
    57  
    58  	return r0, r1
    59  }
    60  
    61  // Index provides a mock function with given fields: result
    62  func (_m *TxIndexer) Index(result *types.TxResult) error {
    63  	ret := _m.Called(result)
    64  
    65  	var r0 error
    66  	if rf, ok := ret.Get(0).(func(*types.TxResult) error); ok {
    67  		r0 = rf(result)
    68  	} else {
    69  		r0 = ret.Error(0)
    70  	}
    71  
    72  	return r0
    73  }
    74  
    75  // Search provides a mock function with given fields: ctx, q
    76  func (_m *TxIndexer) Search(ctx context.Context, q *query.Query) ([]*types.TxResult, error) {
    77  	ret := _m.Called(ctx, q)
    78  
    79  	var r0 []*types.TxResult
    80  	var r1 error
    81  	if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]*types.TxResult, error)); ok {
    82  		return rf(ctx, q)
    83  	}
    84  	if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []*types.TxResult); ok {
    85  		r0 = rf(ctx, q)
    86  	} else {
    87  		if ret.Get(0) != nil {
    88  			r0 = ret.Get(0).([]*types.TxResult)
    89  		}
    90  	}
    91  
    92  	if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok {
    93  		r1 = rf(ctx, q)
    94  	} else {
    95  		r1 = ret.Error(1)
    96  	}
    97  
    98  	return r0, r1
    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  // The first argument is typically a *testing.T value.
   103  func NewTxIndexer(t interface {
   104  	mock.TestingT
   105  	Cleanup(func())
   106  }) *TxIndexer {
   107  	mock := &TxIndexer{}
   108  	mock.Mock.Test(t)
   109  
   110  	t.Cleanup(func() { mock.AssertExpectations(t) })
   111  
   112  	return mock
   113  }