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