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