github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/mempool/mock/chunk_requests.go (about)

     1  // Code generated by mockery v2.21.4. DO NOT EDIT.
     2  
     3  package mempool
     4  
     5  import (
     6  	chunks "github.com/onflow/flow-go/model/chunks"
     7  	flow "github.com/onflow/flow-go/model/flow"
     8  
     9  	mempool "github.com/onflow/flow-go/module/mempool"
    10  
    11  	mock "github.com/stretchr/testify/mock"
    12  
    13  	time "time"
    14  
    15  	verification "github.com/onflow/flow-go/model/verification"
    16  )
    17  
    18  // ChunkRequests is an autogenerated mock type for the ChunkRequests type
    19  type ChunkRequests struct {
    20  	mock.Mock
    21  }
    22  
    23  // Add provides a mock function with given fields: request
    24  func (_m *ChunkRequests) Add(request *verification.ChunkDataPackRequest) bool {
    25  	ret := _m.Called(request)
    26  
    27  	var r0 bool
    28  	if rf, ok := ret.Get(0).(func(*verification.ChunkDataPackRequest) bool); ok {
    29  		r0 = rf(request)
    30  	} else {
    31  		r0 = ret.Get(0).(bool)
    32  	}
    33  
    34  	return r0
    35  }
    36  
    37  // All provides a mock function with given fields:
    38  func (_m *ChunkRequests) All() verification.ChunkDataPackRequestInfoList {
    39  	ret := _m.Called()
    40  
    41  	var r0 verification.ChunkDataPackRequestInfoList
    42  	if rf, ok := ret.Get(0).(func() verification.ChunkDataPackRequestInfoList); ok {
    43  		r0 = rf()
    44  	} else {
    45  		if ret.Get(0) != nil {
    46  			r0 = ret.Get(0).(verification.ChunkDataPackRequestInfoList)
    47  		}
    48  	}
    49  
    50  	return r0
    51  }
    52  
    53  // IncrementAttempt provides a mock function with given fields: chunkID
    54  func (_m *ChunkRequests) IncrementAttempt(chunkID flow.Identifier) bool {
    55  	ret := _m.Called(chunkID)
    56  
    57  	var r0 bool
    58  	if rf, ok := ret.Get(0).(func(flow.Identifier) bool); ok {
    59  		r0 = rf(chunkID)
    60  	} else {
    61  		r0 = ret.Get(0).(bool)
    62  	}
    63  
    64  	return r0
    65  }
    66  
    67  // PopAll provides a mock function with given fields: chunkID
    68  func (_m *ChunkRequests) PopAll(chunkID flow.Identifier) (chunks.LocatorMap, bool) {
    69  	ret := _m.Called(chunkID)
    70  
    71  	var r0 chunks.LocatorMap
    72  	var r1 bool
    73  	if rf, ok := ret.Get(0).(func(flow.Identifier) (chunks.LocatorMap, bool)); ok {
    74  		return rf(chunkID)
    75  	}
    76  	if rf, ok := ret.Get(0).(func(flow.Identifier) chunks.LocatorMap); ok {
    77  		r0 = rf(chunkID)
    78  	} else {
    79  		if ret.Get(0) != nil {
    80  			r0 = ret.Get(0).(chunks.LocatorMap)
    81  		}
    82  	}
    83  
    84  	if rf, ok := ret.Get(1).(func(flow.Identifier) bool); ok {
    85  		r1 = rf(chunkID)
    86  	} else {
    87  		r1 = ret.Get(1).(bool)
    88  	}
    89  
    90  	return r0, r1
    91  }
    92  
    93  // Remove provides a mock function with given fields: chunkID
    94  func (_m *ChunkRequests) Remove(chunkID flow.Identifier) bool {
    95  	ret := _m.Called(chunkID)
    96  
    97  	var r0 bool
    98  	if rf, ok := ret.Get(0).(func(flow.Identifier) bool); ok {
    99  		r0 = rf(chunkID)
   100  	} else {
   101  		r0 = ret.Get(0).(bool)
   102  	}
   103  
   104  	return r0
   105  }
   106  
   107  // RequestHistory provides a mock function with given fields: chunkID
   108  func (_m *ChunkRequests) RequestHistory(chunkID flow.Identifier) (uint64, time.Time, time.Duration, bool) {
   109  	ret := _m.Called(chunkID)
   110  
   111  	var r0 uint64
   112  	var r1 time.Time
   113  	var r2 time.Duration
   114  	var r3 bool
   115  	if rf, ok := ret.Get(0).(func(flow.Identifier) (uint64, time.Time, time.Duration, bool)); ok {
   116  		return rf(chunkID)
   117  	}
   118  	if rf, ok := ret.Get(0).(func(flow.Identifier) uint64); ok {
   119  		r0 = rf(chunkID)
   120  	} else {
   121  		r0 = ret.Get(0).(uint64)
   122  	}
   123  
   124  	if rf, ok := ret.Get(1).(func(flow.Identifier) time.Time); ok {
   125  		r1 = rf(chunkID)
   126  	} else {
   127  		r1 = ret.Get(1).(time.Time)
   128  	}
   129  
   130  	if rf, ok := ret.Get(2).(func(flow.Identifier) time.Duration); ok {
   131  		r2 = rf(chunkID)
   132  	} else {
   133  		r2 = ret.Get(2).(time.Duration)
   134  	}
   135  
   136  	if rf, ok := ret.Get(3).(func(flow.Identifier) bool); ok {
   137  		r3 = rf(chunkID)
   138  	} else {
   139  		r3 = ret.Get(3).(bool)
   140  	}
   141  
   142  	return r0, r1, r2, r3
   143  }
   144  
   145  // Size provides a mock function with given fields:
   146  func (_m *ChunkRequests) Size() uint {
   147  	ret := _m.Called()
   148  
   149  	var r0 uint
   150  	if rf, ok := ret.Get(0).(func() uint); ok {
   151  		r0 = rf()
   152  	} else {
   153  		r0 = ret.Get(0).(uint)
   154  	}
   155  
   156  	return r0
   157  }
   158  
   159  // UpdateRequestHistory provides a mock function with given fields: chunkID, updater
   160  func (_m *ChunkRequests) UpdateRequestHistory(chunkID flow.Identifier, updater mempool.ChunkRequestHistoryUpdaterFunc) (uint64, time.Time, time.Duration, bool) {
   161  	ret := _m.Called(chunkID, updater)
   162  
   163  	var r0 uint64
   164  	var r1 time.Time
   165  	var r2 time.Duration
   166  	var r3 bool
   167  	if rf, ok := ret.Get(0).(func(flow.Identifier, mempool.ChunkRequestHistoryUpdaterFunc) (uint64, time.Time, time.Duration, bool)); ok {
   168  		return rf(chunkID, updater)
   169  	}
   170  	if rf, ok := ret.Get(0).(func(flow.Identifier, mempool.ChunkRequestHistoryUpdaterFunc) uint64); ok {
   171  		r0 = rf(chunkID, updater)
   172  	} else {
   173  		r0 = ret.Get(0).(uint64)
   174  	}
   175  
   176  	if rf, ok := ret.Get(1).(func(flow.Identifier, mempool.ChunkRequestHistoryUpdaterFunc) time.Time); ok {
   177  		r1 = rf(chunkID, updater)
   178  	} else {
   179  		r1 = ret.Get(1).(time.Time)
   180  	}
   181  
   182  	if rf, ok := ret.Get(2).(func(flow.Identifier, mempool.ChunkRequestHistoryUpdaterFunc) time.Duration); ok {
   183  		r2 = rf(chunkID, updater)
   184  	} else {
   185  		r2 = ret.Get(2).(time.Duration)
   186  	}
   187  
   188  	if rf, ok := ret.Get(3).(func(flow.Identifier, mempool.ChunkRequestHistoryUpdaterFunc) bool); ok {
   189  		r3 = rf(chunkID, updater)
   190  	} else {
   191  		r3 = ret.Get(3).(bool)
   192  	}
   193  
   194  	return r0, r1, r2, r3
   195  }
   196  
   197  type mockConstructorTestingTNewChunkRequests interface {
   198  	mock.TestingT
   199  	Cleanup(func())
   200  }
   201  
   202  // NewChunkRequests creates a new instance of ChunkRequests. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   203  func NewChunkRequests(t mockConstructorTestingTNewChunkRequests) *ChunkRequests {
   204  	mock := &ChunkRequests{}
   205  	mock.Mock.Test(t)
   206  
   207  	t.Cleanup(func() { mock.AssertExpectations(t) })
   208  
   209  	return mock
   210  }