github.com/iotexproject/iotex-core@v1.14.1-rc1/consensus/consensusfsm/mock_context_test.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: ./consensus/consensusfsm/context.go 3 4 // Package consensusfsm is a generated GoMock package. 5 package consensusfsm 6 7 import ( 8 context "context" 9 reflect "reflect" 10 time "time" 11 12 gomock "github.com/golang/mock/gomock" 13 go_fsm "github.com/iotexproject/go-fsm" 14 zap "go.uber.org/zap" 15 ) 16 17 // MockContext is a mock of Context interface. 18 type MockContext struct { 19 ctrl *gomock.Controller 20 recorder *MockContextMockRecorder 21 } 22 23 // MockContextMockRecorder is the mock recorder for MockContext. 24 type MockContextMockRecorder struct { 25 mock *MockContext 26 } 27 28 // NewMockContext creates a new mock instance. 29 func NewMockContext(ctrl *gomock.Controller) *MockContext { 30 mock := &MockContext{ctrl: ctrl} 31 mock.recorder = &MockContextMockRecorder{mock} 32 return mock 33 } 34 35 // EXPECT returns an object that allows the caller to indicate expected use. 36 func (m *MockContext) EXPECT() *MockContextMockRecorder { 37 return m.recorder 38 } 39 40 // AcceptBlockTTL mocks base method. 41 func (m *MockContext) AcceptBlockTTL(arg0 uint64) time.Duration { 42 m.ctrl.T.Helper() 43 ret := m.ctrl.Call(m, "AcceptBlockTTL", arg0) 44 ret0, _ := ret[0].(time.Duration) 45 return ret0 46 } 47 48 // AcceptBlockTTL indicates an expected call of AcceptBlockTTL. 49 func (mr *MockContextMockRecorder) AcceptBlockTTL(arg0 interface{}) *gomock.Call { 50 mr.mock.ctrl.T.Helper() 51 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcceptBlockTTL", reflect.TypeOf((*MockContext)(nil).AcceptBlockTTL), arg0) 52 } 53 54 // AcceptLockEndorsementTTL mocks base method. 55 func (m *MockContext) AcceptLockEndorsementTTL(arg0 uint64) time.Duration { 56 m.ctrl.T.Helper() 57 ret := m.ctrl.Call(m, "AcceptLockEndorsementTTL", arg0) 58 ret0, _ := ret[0].(time.Duration) 59 return ret0 60 } 61 62 // AcceptLockEndorsementTTL indicates an expected call of AcceptLockEndorsementTTL. 63 func (mr *MockContextMockRecorder) AcceptLockEndorsementTTL(arg0 interface{}) *gomock.Call { 64 mr.mock.ctrl.T.Helper() 65 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcceptLockEndorsementTTL", reflect.TypeOf((*MockContext)(nil).AcceptLockEndorsementTTL), arg0) 66 } 67 68 // AcceptProposalEndorsementTTL mocks base method. 69 func (m *MockContext) AcceptProposalEndorsementTTL(arg0 uint64) time.Duration { 70 m.ctrl.T.Helper() 71 ret := m.ctrl.Call(m, "AcceptProposalEndorsementTTL", arg0) 72 ret0, _ := ret[0].(time.Duration) 73 return ret0 74 } 75 76 // AcceptProposalEndorsementTTL indicates an expected call of AcceptProposalEndorsementTTL. 77 func (mr *MockContextMockRecorder) AcceptProposalEndorsementTTL(arg0 interface{}) *gomock.Call { 78 mr.mock.ctrl.T.Helper() 79 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AcceptProposalEndorsementTTL", reflect.TypeOf((*MockContext)(nil).AcceptProposalEndorsementTTL), arg0) 80 } 81 82 // Activate mocks base method. 83 func (m *MockContext) Activate(arg0 bool) { 84 m.ctrl.T.Helper() 85 m.ctrl.Call(m, "Activate", arg0) 86 } 87 88 // Activate indicates an expected call of Activate. 89 func (mr *MockContextMockRecorder) Activate(arg0 interface{}) *gomock.Call { 90 mr.mock.ctrl.T.Helper() 91 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Activate", reflect.TypeOf((*MockContext)(nil).Activate), arg0) 92 } 93 94 // Active mocks base method. 95 func (m *MockContext) Active() bool { 96 m.ctrl.T.Helper() 97 ret := m.ctrl.Call(m, "Active") 98 ret0, _ := ret[0].(bool) 99 return ret0 100 } 101 102 // Active indicates an expected call of Active. 103 func (mr *MockContextMockRecorder) Active() *gomock.Call { 104 mr.mock.ctrl.T.Helper() 105 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Active", reflect.TypeOf((*MockContext)(nil).Active)) 106 } 107 108 // BlockInterval mocks base method. 109 func (m *MockContext) BlockInterval(arg0 uint64) time.Duration { 110 m.ctrl.T.Helper() 111 ret := m.ctrl.Call(m, "BlockInterval", arg0) 112 ret0, _ := ret[0].(time.Duration) 113 return ret0 114 } 115 116 // BlockInterval indicates an expected call of BlockInterval. 117 func (mr *MockContextMockRecorder) BlockInterval(arg0 interface{}) *gomock.Call { 118 mr.mock.ctrl.T.Helper() 119 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockInterval", reflect.TypeOf((*MockContext)(nil).BlockInterval), arg0) 120 } 121 122 // Broadcast mocks base method. 123 func (m *MockContext) Broadcast(arg0 interface{}) { 124 m.ctrl.T.Helper() 125 m.ctrl.Call(m, "Broadcast", arg0) 126 } 127 128 // Broadcast indicates an expected call of Broadcast. 129 func (mr *MockContextMockRecorder) Broadcast(arg0 interface{}) *gomock.Call { 130 mr.mock.ctrl.T.Helper() 131 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Broadcast", reflect.TypeOf((*MockContext)(nil).Broadcast), arg0) 132 } 133 134 // Commit mocks base method. 135 func (m *MockContext) Commit(arg0 interface{}) (bool, error) { 136 m.ctrl.T.Helper() 137 ret := m.ctrl.Call(m, "Commit", arg0) 138 ret0, _ := ret[0].(bool) 139 ret1, _ := ret[1].(error) 140 return ret0, ret1 141 } 142 143 // Commit indicates an expected call of Commit. 144 func (mr *MockContextMockRecorder) Commit(arg0 interface{}) *gomock.Call { 145 mr.mock.ctrl.T.Helper() 146 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Commit", reflect.TypeOf((*MockContext)(nil).Commit), arg0) 147 } 148 149 // CommitTTL mocks base method. 150 func (m *MockContext) CommitTTL(arg0 uint64) time.Duration { 151 m.ctrl.T.Helper() 152 ret := m.ctrl.Call(m, "CommitTTL", arg0) 153 ret0, _ := ret[0].(time.Duration) 154 return ret0 155 } 156 157 // CommitTTL indicates an expected call of CommitTTL. 158 func (mr *MockContextMockRecorder) CommitTTL(arg0 interface{}) *gomock.Call { 159 mr.mock.ctrl.T.Helper() 160 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitTTL", reflect.TypeOf((*MockContext)(nil).CommitTTL), arg0) 161 } 162 163 // Delay mocks base method. 164 func (m *MockContext) Delay(arg0 uint64) time.Duration { 165 m.ctrl.T.Helper() 166 ret := m.ctrl.Call(m, "Delay", arg0) 167 ret0, _ := ret[0].(time.Duration) 168 return ret0 169 } 170 171 // Delay indicates an expected call of Delay. 172 func (mr *MockContextMockRecorder) Delay(arg0 interface{}) *gomock.Call { 173 mr.mock.ctrl.T.Helper() 174 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delay", reflect.TypeOf((*MockContext)(nil).Delay), arg0) 175 } 176 177 // EventChanSize mocks base method. 178 func (m *MockContext) EventChanSize() uint { 179 m.ctrl.T.Helper() 180 ret := m.ctrl.Call(m, "EventChanSize") 181 ret0, _ := ret[0].(uint) 182 return ret0 183 } 184 185 // EventChanSize indicates an expected call of EventChanSize. 186 func (mr *MockContextMockRecorder) EventChanSize() *gomock.Call { 187 mr.mock.ctrl.T.Helper() 188 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventChanSize", reflect.TypeOf((*MockContext)(nil).EventChanSize)) 189 } 190 191 // Height mocks base method. 192 func (m *MockContext) Height() uint64 { 193 m.ctrl.T.Helper() 194 ret := m.ctrl.Call(m, "Height") 195 ret0, _ := ret[0].(uint64) 196 return ret0 197 } 198 199 // Height indicates an expected call of Height. 200 func (mr *MockContextMockRecorder) Height() *gomock.Call { 201 mr.mock.ctrl.T.Helper() 202 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Height", reflect.TypeOf((*MockContext)(nil).Height)) 203 } 204 205 // IsDelegate mocks base method. 206 func (m *MockContext) IsDelegate() bool { 207 m.ctrl.T.Helper() 208 ret := m.ctrl.Call(m, "IsDelegate") 209 ret0, _ := ret[0].(bool) 210 return ret0 211 } 212 213 // IsDelegate indicates an expected call of IsDelegate. 214 func (mr *MockContextMockRecorder) IsDelegate() *gomock.Call { 215 mr.mock.ctrl.T.Helper() 216 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsDelegate", reflect.TypeOf((*MockContext)(nil).IsDelegate)) 217 } 218 219 // IsFutureEvent mocks base method. 220 func (m *MockContext) IsFutureEvent(arg0 *ConsensusEvent) bool { 221 m.ctrl.T.Helper() 222 ret := m.ctrl.Call(m, "IsFutureEvent", arg0) 223 ret0, _ := ret[0].(bool) 224 return ret0 225 } 226 227 // IsFutureEvent indicates an expected call of IsFutureEvent. 228 func (mr *MockContextMockRecorder) IsFutureEvent(arg0 interface{}) *gomock.Call { 229 mr.mock.ctrl.T.Helper() 230 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsFutureEvent", reflect.TypeOf((*MockContext)(nil).IsFutureEvent), arg0) 231 } 232 233 // IsStaleEvent mocks base method. 234 func (m *MockContext) IsStaleEvent(arg0 *ConsensusEvent) bool { 235 m.ctrl.T.Helper() 236 ret := m.ctrl.Call(m, "IsStaleEvent", arg0) 237 ret0, _ := ret[0].(bool) 238 return ret0 239 } 240 241 // IsStaleEvent indicates an expected call of IsStaleEvent. 242 func (mr *MockContextMockRecorder) IsStaleEvent(arg0 interface{}) *gomock.Call { 243 mr.mock.ctrl.T.Helper() 244 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsStaleEvent", reflect.TypeOf((*MockContext)(nil).IsStaleEvent), arg0) 245 } 246 247 // IsStaleUnmatchedEvent mocks base method. 248 func (m *MockContext) IsStaleUnmatchedEvent(arg0 *ConsensusEvent) bool { 249 m.ctrl.T.Helper() 250 ret := m.ctrl.Call(m, "IsStaleUnmatchedEvent", arg0) 251 ret0, _ := ret[0].(bool) 252 return ret0 253 } 254 255 // IsStaleUnmatchedEvent indicates an expected call of IsStaleUnmatchedEvent. 256 func (mr *MockContextMockRecorder) IsStaleUnmatchedEvent(arg0 interface{}) *gomock.Call { 257 mr.mock.ctrl.T.Helper() 258 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsStaleUnmatchedEvent", reflect.TypeOf((*MockContext)(nil).IsStaleUnmatchedEvent), arg0) 259 } 260 261 // Logger mocks base method. 262 func (m *MockContext) Logger() *zap.Logger { 263 m.ctrl.T.Helper() 264 ret := m.ctrl.Call(m, "Logger") 265 ret0, _ := ret[0].(*zap.Logger) 266 return ret0 267 } 268 269 // Logger indicates an expected call of Logger. 270 func (mr *MockContextMockRecorder) Logger() *gomock.Call { 271 mr.mock.ctrl.T.Helper() 272 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Logger", reflect.TypeOf((*MockContext)(nil).Logger)) 273 } 274 275 // NewBackdoorEvt mocks base method. 276 func (m *MockContext) NewBackdoorEvt(arg0 go_fsm.State) *ConsensusEvent { 277 m.ctrl.T.Helper() 278 ret := m.ctrl.Call(m, "NewBackdoorEvt", arg0) 279 ret0, _ := ret[0].(*ConsensusEvent) 280 return ret0 281 } 282 283 // NewBackdoorEvt indicates an expected call of NewBackdoorEvt. 284 func (mr *MockContextMockRecorder) NewBackdoorEvt(arg0 interface{}) *gomock.Call { 285 mr.mock.ctrl.T.Helper() 286 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewBackdoorEvt", reflect.TypeOf((*MockContext)(nil).NewBackdoorEvt), arg0) 287 } 288 289 // NewConsensusEvent mocks base method. 290 func (m *MockContext) NewConsensusEvent(arg0 go_fsm.EventType, arg1 interface{}) *ConsensusEvent { 291 m.ctrl.T.Helper() 292 ret := m.ctrl.Call(m, "NewConsensusEvent", arg0, arg1) 293 ret0, _ := ret[0].(*ConsensusEvent) 294 return ret0 295 } 296 297 // NewConsensusEvent indicates an expected call of NewConsensusEvent. 298 func (mr *MockContextMockRecorder) NewConsensusEvent(arg0, arg1 interface{}) *gomock.Call { 299 mr.mock.ctrl.T.Helper() 300 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewConsensusEvent", reflect.TypeOf((*MockContext)(nil).NewConsensusEvent), arg0, arg1) 301 } 302 303 // NewLockEndorsement mocks base method. 304 func (m *MockContext) NewLockEndorsement(arg0 interface{}) (interface{}, error) { 305 m.ctrl.T.Helper() 306 ret := m.ctrl.Call(m, "NewLockEndorsement", arg0) 307 ret0, _ := ret[0].(interface{}) 308 ret1, _ := ret[1].(error) 309 return ret0, ret1 310 } 311 312 // NewLockEndorsement indicates an expected call of NewLockEndorsement. 313 func (mr *MockContextMockRecorder) NewLockEndorsement(arg0 interface{}) *gomock.Call { 314 mr.mock.ctrl.T.Helper() 315 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewLockEndorsement", reflect.TypeOf((*MockContext)(nil).NewLockEndorsement), arg0) 316 } 317 318 // NewPreCommitEndorsement mocks base method. 319 func (m *MockContext) NewPreCommitEndorsement(arg0 interface{}) (interface{}, error) { 320 m.ctrl.T.Helper() 321 ret := m.ctrl.Call(m, "NewPreCommitEndorsement", arg0) 322 ret0, _ := ret[0].(interface{}) 323 ret1, _ := ret[1].(error) 324 return ret0, ret1 325 } 326 327 // NewPreCommitEndorsement indicates an expected call of NewPreCommitEndorsement. 328 func (mr *MockContextMockRecorder) NewPreCommitEndorsement(arg0 interface{}) *gomock.Call { 329 mr.mock.ctrl.T.Helper() 330 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewPreCommitEndorsement", reflect.TypeOf((*MockContext)(nil).NewPreCommitEndorsement), arg0) 331 } 332 333 // NewProposalEndorsement mocks base method. 334 func (m *MockContext) NewProposalEndorsement(arg0 interface{}) (interface{}, error) { 335 m.ctrl.T.Helper() 336 ret := m.ctrl.Call(m, "NewProposalEndorsement", arg0) 337 ret0, _ := ret[0].(interface{}) 338 ret1, _ := ret[1].(error) 339 return ret0, ret1 340 } 341 342 // NewProposalEndorsement indicates an expected call of NewProposalEndorsement. 343 func (mr *MockContextMockRecorder) NewProposalEndorsement(arg0 interface{}) *gomock.Call { 344 mr.mock.ctrl.T.Helper() 345 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewProposalEndorsement", reflect.TypeOf((*MockContext)(nil).NewProposalEndorsement), arg0) 346 } 347 348 // PreCommitEndorsement mocks base method. 349 func (m *MockContext) PreCommitEndorsement() interface{} { 350 m.ctrl.T.Helper() 351 ret := m.ctrl.Call(m, "PreCommitEndorsement") 352 ret0, _ := ret[0].(interface{}) 353 return ret0 354 } 355 356 // PreCommitEndorsement indicates an expected call of PreCommitEndorsement. 357 func (mr *MockContextMockRecorder) PreCommitEndorsement() *gomock.Call { 358 mr.mock.ctrl.T.Helper() 359 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PreCommitEndorsement", reflect.TypeOf((*MockContext)(nil).PreCommitEndorsement)) 360 } 361 362 // Prepare mocks base method. 363 func (m *MockContext) Prepare() error { 364 m.ctrl.T.Helper() 365 ret := m.ctrl.Call(m, "Prepare") 366 ret0, _ := ret[0].(error) 367 return ret0 368 } 369 370 // Prepare indicates an expected call of Prepare. 371 func (mr *MockContextMockRecorder) Prepare() *gomock.Call { 372 mr.mock.ctrl.T.Helper() 373 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Prepare", reflect.TypeOf((*MockContext)(nil).Prepare)) 374 } 375 376 // Proposal mocks base method. 377 func (m *MockContext) Proposal() (interface{}, error) { 378 m.ctrl.T.Helper() 379 ret := m.ctrl.Call(m, "Proposal") 380 ret0, _ := ret[0].(interface{}) 381 ret1, _ := ret[1].(error) 382 return ret0, ret1 383 } 384 385 // Proposal indicates an expected call of Proposal. 386 func (mr *MockContextMockRecorder) Proposal() *gomock.Call { 387 mr.mock.ctrl.T.Helper() 388 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Proposal", reflect.TypeOf((*MockContext)(nil).Proposal)) 389 } 390 391 // Start mocks base method. 392 func (m *MockContext) Start(arg0 context.Context) error { 393 m.ctrl.T.Helper() 394 ret := m.ctrl.Call(m, "Start", arg0) 395 ret0, _ := ret[0].(error) 396 return ret0 397 } 398 399 // Start indicates an expected call of Start. 400 func (mr *MockContextMockRecorder) Start(arg0 interface{}) *gomock.Call { 401 mr.mock.ctrl.T.Helper() 402 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockContext)(nil).Start), arg0) 403 } 404 405 // Stop mocks base method. 406 func (m *MockContext) Stop(arg0 context.Context) error { 407 m.ctrl.T.Helper() 408 ret := m.ctrl.Call(m, "Stop", arg0) 409 ret0, _ := ret[0].(error) 410 return ret0 411 } 412 413 // Stop indicates an expected call of Stop. 414 func (mr *MockContextMockRecorder) Stop(arg0 interface{}) *gomock.Call { 415 mr.mock.ctrl.T.Helper() 416 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockContext)(nil).Stop), arg0) 417 } 418 419 // UnmatchedEventInterval mocks base method. 420 func (m *MockContext) UnmatchedEventInterval(arg0 uint64) time.Duration { 421 m.ctrl.T.Helper() 422 ret := m.ctrl.Call(m, "UnmatchedEventInterval", arg0) 423 ret0, _ := ret[0].(time.Duration) 424 return ret0 425 } 426 427 // UnmatchedEventInterval indicates an expected call of UnmatchedEventInterval. 428 func (mr *MockContextMockRecorder) UnmatchedEventInterval(arg0 interface{}) *gomock.Call { 429 mr.mock.ctrl.T.Helper() 430 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnmatchedEventInterval", reflect.TypeOf((*MockContext)(nil).UnmatchedEventInterval), arg0) 431 } 432 433 // UnmatchedEventTTL mocks base method. 434 func (m *MockContext) UnmatchedEventTTL(arg0 uint64) time.Duration { 435 m.ctrl.T.Helper() 436 ret := m.ctrl.Call(m, "UnmatchedEventTTL", arg0) 437 ret0, _ := ret[0].(time.Duration) 438 return ret0 439 } 440 441 // UnmatchedEventTTL indicates an expected call of UnmatchedEventTTL. 442 func (mr *MockContextMockRecorder) UnmatchedEventTTL(arg0 interface{}) *gomock.Call { 443 mr.mock.ctrl.T.Helper() 444 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnmatchedEventTTL", reflect.TypeOf((*MockContext)(nil).UnmatchedEventTTL), arg0) 445 } 446 447 // WaitUntilRoundStart mocks base method. 448 func (m *MockContext) WaitUntilRoundStart() time.Duration { 449 m.ctrl.T.Helper() 450 ret := m.ctrl.Call(m, "WaitUntilRoundStart") 451 ret0, _ := ret[0].(time.Duration) 452 return ret0 453 } 454 455 // WaitUntilRoundStart indicates an expected call of WaitUntilRoundStart. 456 func (mr *MockContextMockRecorder) WaitUntilRoundStart() *gomock.Call { 457 mr.mock.ctrl.T.Helper() 458 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitUntilRoundStart", reflect.TypeOf((*MockContext)(nil).WaitUntilRoundStart)) 459 }