github.com/onflow/flow-go@v0.33.17/module/mempool/mock/transaction_timings.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mempool 4 5 import ( 6 flow "github.com/onflow/flow-go/model/flow" 7 8 mock "github.com/stretchr/testify/mock" 9 ) 10 11 // TransactionTimings is an autogenerated mock type for the TransactionTimings type 12 type TransactionTimings struct { 13 mock.Mock 14 } 15 16 // Add provides a mock function with given fields: tx 17 func (_m *TransactionTimings) Add(tx *flow.TransactionTiming) bool { 18 ret := _m.Called(tx) 19 20 var r0 bool 21 if rf, ok := ret.Get(0).(func(*flow.TransactionTiming) bool); ok { 22 r0 = rf(tx) 23 } else { 24 r0 = ret.Get(0).(bool) 25 } 26 27 return r0 28 } 29 30 // Adjust provides a mock function with given fields: txID, f 31 func (_m *TransactionTimings) Adjust(txID flow.Identifier, f func(*flow.TransactionTiming) *flow.TransactionTiming) (*flow.TransactionTiming, bool) { 32 ret := _m.Called(txID, f) 33 34 var r0 *flow.TransactionTiming 35 var r1 bool 36 if rf, ok := ret.Get(0).(func(flow.Identifier, func(*flow.TransactionTiming) *flow.TransactionTiming) (*flow.TransactionTiming, bool)); ok { 37 return rf(txID, f) 38 } 39 if rf, ok := ret.Get(0).(func(flow.Identifier, func(*flow.TransactionTiming) *flow.TransactionTiming) *flow.TransactionTiming); ok { 40 r0 = rf(txID, f) 41 } else { 42 if ret.Get(0) != nil { 43 r0 = ret.Get(0).(*flow.TransactionTiming) 44 } 45 } 46 47 if rf, ok := ret.Get(1).(func(flow.Identifier, func(*flow.TransactionTiming) *flow.TransactionTiming) bool); ok { 48 r1 = rf(txID, f) 49 } else { 50 r1 = ret.Get(1).(bool) 51 } 52 53 return r0, r1 54 } 55 56 // All provides a mock function with given fields: 57 func (_m *TransactionTimings) All() []*flow.TransactionTiming { 58 ret := _m.Called() 59 60 var r0 []*flow.TransactionTiming 61 if rf, ok := ret.Get(0).(func() []*flow.TransactionTiming); ok { 62 r0 = rf() 63 } else { 64 if ret.Get(0) != nil { 65 r0 = ret.Get(0).([]*flow.TransactionTiming) 66 } 67 } 68 69 return r0 70 } 71 72 // ByID provides a mock function with given fields: txID 73 func (_m *TransactionTimings) ByID(txID flow.Identifier) (*flow.TransactionTiming, bool) { 74 ret := _m.Called(txID) 75 76 var r0 *flow.TransactionTiming 77 var r1 bool 78 if rf, ok := ret.Get(0).(func(flow.Identifier) (*flow.TransactionTiming, bool)); ok { 79 return rf(txID) 80 } 81 if rf, ok := ret.Get(0).(func(flow.Identifier) *flow.TransactionTiming); ok { 82 r0 = rf(txID) 83 } else { 84 if ret.Get(0) != nil { 85 r0 = ret.Get(0).(*flow.TransactionTiming) 86 } 87 } 88 89 if rf, ok := ret.Get(1).(func(flow.Identifier) bool); ok { 90 r1 = rf(txID) 91 } else { 92 r1 = ret.Get(1).(bool) 93 } 94 95 return r0, r1 96 } 97 98 // Remove provides a mock function with given fields: txID 99 func (_m *TransactionTimings) Remove(txID flow.Identifier) bool { 100 ret := _m.Called(txID) 101 102 var r0 bool 103 if rf, ok := ret.Get(0).(func(flow.Identifier) bool); ok { 104 r0 = rf(txID) 105 } else { 106 r0 = ret.Get(0).(bool) 107 } 108 109 return r0 110 } 111 112 type mockConstructorTestingTNewTransactionTimings interface { 113 mock.TestingT 114 Cleanup(func()) 115 } 116 117 // NewTransactionTimings creates a new instance of TransactionTimings. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 118 func NewTransactionTimings(t mockConstructorTestingTNewTransactionTimings) *TransactionTimings { 119 mock := &TransactionTimings{} 120 mock.Mock.Test(t) 121 122 t.Cleanup(func() { mock.AssertExpectations(t) }) 123 124 return mock 125 }