github.com/renegr87/renegr87@v2.1.1+incompatible/core/ledger/kvledger/txmgmt/txmgr/mock/tx_mgr.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mock 3 4 import ( 5 "sync" 6 7 "github.com/hyperledger/fabric/core/ledger" 8 "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/txmgr" 9 "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/version" 10 ) 11 12 type TxMgr struct { 13 CommitStub func() error 14 commitMutex sync.RWMutex 15 commitArgsForCall []struct { 16 } 17 commitReturns struct { 18 result1 error 19 } 20 commitReturnsOnCall map[int]struct { 21 result1 error 22 } 23 CommitLostBlockStub func(*ledger.BlockAndPvtData) error 24 commitLostBlockMutex sync.RWMutex 25 commitLostBlockArgsForCall []struct { 26 arg1 *ledger.BlockAndPvtData 27 } 28 commitLostBlockReturns struct { 29 result1 error 30 } 31 commitLostBlockReturnsOnCall map[int]struct { 32 result1 error 33 } 34 GetLastSavepointStub func() (*version.Height, error) 35 getLastSavepointMutex sync.RWMutex 36 getLastSavepointArgsForCall []struct { 37 } 38 getLastSavepointReturns struct { 39 result1 *version.Height 40 result2 error 41 } 42 getLastSavepointReturnsOnCall map[int]struct { 43 result1 *version.Height 44 result2 error 45 } 46 NameStub func() string 47 nameMutex sync.RWMutex 48 nameArgsForCall []struct { 49 } 50 nameReturns struct { 51 result1 string 52 } 53 nameReturnsOnCall map[int]struct { 54 result1 string 55 } 56 NewQueryExecutorStub func(string) (ledger.QueryExecutor, error) 57 newQueryExecutorMutex sync.RWMutex 58 newQueryExecutorArgsForCall []struct { 59 arg1 string 60 } 61 newQueryExecutorReturns struct { 62 result1 ledger.QueryExecutor 63 result2 error 64 } 65 newQueryExecutorReturnsOnCall map[int]struct { 66 result1 ledger.QueryExecutor 67 result2 error 68 } 69 NewTxSimulatorStub func(string) (ledger.TxSimulator, error) 70 newTxSimulatorMutex sync.RWMutex 71 newTxSimulatorArgsForCall []struct { 72 arg1 string 73 } 74 newTxSimulatorReturns struct { 75 result1 ledger.TxSimulator 76 result2 error 77 } 78 newTxSimulatorReturnsOnCall map[int]struct { 79 result1 ledger.TxSimulator 80 result2 error 81 } 82 RemoveStaleAndCommitPvtDataOfOldBlocksStub func(map[uint64][]*ledger.TxPvtData) error 83 removeStaleAndCommitPvtDataOfOldBlocksMutex sync.RWMutex 84 removeStaleAndCommitPvtDataOfOldBlocksArgsForCall []struct { 85 arg1 map[uint64][]*ledger.TxPvtData 86 } 87 removeStaleAndCommitPvtDataOfOldBlocksReturns struct { 88 result1 error 89 } 90 removeStaleAndCommitPvtDataOfOldBlocksReturnsOnCall map[int]struct { 91 result1 error 92 } 93 RollbackStub func() 94 rollbackMutex sync.RWMutex 95 rollbackArgsForCall []struct { 96 } 97 ShouldRecoverStub func(uint64) (bool, uint64, error) 98 shouldRecoverMutex sync.RWMutex 99 shouldRecoverArgsForCall []struct { 100 arg1 uint64 101 } 102 shouldRecoverReturns struct { 103 result1 bool 104 result2 uint64 105 result3 error 106 } 107 shouldRecoverReturnsOnCall map[int]struct { 108 result1 bool 109 result2 uint64 110 result3 error 111 } 112 ShutdownStub func() 113 shutdownMutex sync.RWMutex 114 shutdownArgsForCall []struct { 115 } 116 ValidateAndPrepareStub func(*ledger.BlockAndPvtData, bool) ([]*txmgr.TxStatInfo, []byte, error) 117 validateAndPrepareMutex sync.RWMutex 118 validateAndPrepareArgsForCall []struct { 119 arg1 *ledger.BlockAndPvtData 120 arg2 bool 121 } 122 validateAndPrepareReturns struct { 123 result1 []*txmgr.TxStatInfo 124 result2 []byte 125 result3 error 126 } 127 validateAndPrepareReturnsOnCall map[int]struct { 128 result1 []*txmgr.TxStatInfo 129 result2 []byte 130 result3 error 131 } 132 invocations map[string][][]interface{} 133 invocationsMutex sync.RWMutex 134 } 135 136 func (fake *TxMgr) Commit() error { 137 fake.commitMutex.Lock() 138 ret, specificReturn := fake.commitReturnsOnCall[len(fake.commitArgsForCall)] 139 fake.commitArgsForCall = append(fake.commitArgsForCall, struct { 140 }{}) 141 fake.recordInvocation("Commit", []interface{}{}) 142 fake.commitMutex.Unlock() 143 if fake.CommitStub != nil { 144 return fake.CommitStub() 145 } 146 if specificReturn { 147 return ret.result1 148 } 149 fakeReturns := fake.commitReturns 150 return fakeReturns.result1 151 } 152 153 func (fake *TxMgr) CommitCallCount() int { 154 fake.commitMutex.RLock() 155 defer fake.commitMutex.RUnlock() 156 return len(fake.commitArgsForCall) 157 } 158 159 func (fake *TxMgr) CommitCalls(stub func() error) { 160 fake.commitMutex.Lock() 161 defer fake.commitMutex.Unlock() 162 fake.CommitStub = stub 163 } 164 165 func (fake *TxMgr) CommitReturns(result1 error) { 166 fake.commitMutex.Lock() 167 defer fake.commitMutex.Unlock() 168 fake.CommitStub = nil 169 fake.commitReturns = struct { 170 result1 error 171 }{result1} 172 } 173 174 func (fake *TxMgr) CommitReturnsOnCall(i int, result1 error) { 175 fake.commitMutex.Lock() 176 defer fake.commitMutex.Unlock() 177 fake.CommitStub = nil 178 if fake.commitReturnsOnCall == nil { 179 fake.commitReturnsOnCall = make(map[int]struct { 180 result1 error 181 }) 182 } 183 fake.commitReturnsOnCall[i] = struct { 184 result1 error 185 }{result1} 186 } 187 188 func (fake *TxMgr) CommitLostBlock(arg1 *ledger.BlockAndPvtData) error { 189 fake.commitLostBlockMutex.Lock() 190 ret, specificReturn := fake.commitLostBlockReturnsOnCall[len(fake.commitLostBlockArgsForCall)] 191 fake.commitLostBlockArgsForCall = append(fake.commitLostBlockArgsForCall, struct { 192 arg1 *ledger.BlockAndPvtData 193 }{arg1}) 194 fake.recordInvocation("CommitLostBlock", []interface{}{arg1}) 195 fake.commitLostBlockMutex.Unlock() 196 if fake.CommitLostBlockStub != nil { 197 return fake.CommitLostBlockStub(arg1) 198 } 199 if specificReturn { 200 return ret.result1 201 } 202 fakeReturns := fake.commitLostBlockReturns 203 return fakeReturns.result1 204 } 205 206 func (fake *TxMgr) CommitLostBlockCallCount() int { 207 fake.commitLostBlockMutex.RLock() 208 defer fake.commitLostBlockMutex.RUnlock() 209 return len(fake.commitLostBlockArgsForCall) 210 } 211 212 func (fake *TxMgr) CommitLostBlockCalls(stub func(*ledger.BlockAndPvtData) error) { 213 fake.commitLostBlockMutex.Lock() 214 defer fake.commitLostBlockMutex.Unlock() 215 fake.CommitLostBlockStub = stub 216 } 217 218 func (fake *TxMgr) CommitLostBlockArgsForCall(i int) *ledger.BlockAndPvtData { 219 fake.commitLostBlockMutex.RLock() 220 defer fake.commitLostBlockMutex.RUnlock() 221 argsForCall := fake.commitLostBlockArgsForCall[i] 222 return argsForCall.arg1 223 } 224 225 func (fake *TxMgr) CommitLostBlockReturns(result1 error) { 226 fake.commitLostBlockMutex.Lock() 227 defer fake.commitLostBlockMutex.Unlock() 228 fake.CommitLostBlockStub = nil 229 fake.commitLostBlockReturns = struct { 230 result1 error 231 }{result1} 232 } 233 234 func (fake *TxMgr) CommitLostBlockReturnsOnCall(i int, result1 error) { 235 fake.commitLostBlockMutex.Lock() 236 defer fake.commitLostBlockMutex.Unlock() 237 fake.CommitLostBlockStub = nil 238 if fake.commitLostBlockReturnsOnCall == nil { 239 fake.commitLostBlockReturnsOnCall = make(map[int]struct { 240 result1 error 241 }) 242 } 243 fake.commitLostBlockReturnsOnCall[i] = struct { 244 result1 error 245 }{result1} 246 } 247 248 func (fake *TxMgr) GetLastSavepoint() (*version.Height, error) { 249 fake.getLastSavepointMutex.Lock() 250 ret, specificReturn := fake.getLastSavepointReturnsOnCall[len(fake.getLastSavepointArgsForCall)] 251 fake.getLastSavepointArgsForCall = append(fake.getLastSavepointArgsForCall, struct { 252 }{}) 253 fake.recordInvocation("GetLastSavepoint", []interface{}{}) 254 fake.getLastSavepointMutex.Unlock() 255 if fake.GetLastSavepointStub != nil { 256 return fake.GetLastSavepointStub() 257 } 258 if specificReturn { 259 return ret.result1, ret.result2 260 } 261 fakeReturns := fake.getLastSavepointReturns 262 return fakeReturns.result1, fakeReturns.result2 263 } 264 265 func (fake *TxMgr) GetLastSavepointCallCount() int { 266 fake.getLastSavepointMutex.RLock() 267 defer fake.getLastSavepointMutex.RUnlock() 268 return len(fake.getLastSavepointArgsForCall) 269 } 270 271 func (fake *TxMgr) GetLastSavepointCalls(stub func() (*version.Height, error)) { 272 fake.getLastSavepointMutex.Lock() 273 defer fake.getLastSavepointMutex.Unlock() 274 fake.GetLastSavepointStub = stub 275 } 276 277 func (fake *TxMgr) GetLastSavepointReturns(result1 *version.Height, result2 error) { 278 fake.getLastSavepointMutex.Lock() 279 defer fake.getLastSavepointMutex.Unlock() 280 fake.GetLastSavepointStub = nil 281 fake.getLastSavepointReturns = struct { 282 result1 *version.Height 283 result2 error 284 }{result1, result2} 285 } 286 287 func (fake *TxMgr) GetLastSavepointReturnsOnCall(i int, result1 *version.Height, result2 error) { 288 fake.getLastSavepointMutex.Lock() 289 defer fake.getLastSavepointMutex.Unlock() 290 fake.GetLastSavepointStub = nil 291 if fake.getLastSavepointReturnsOnCall == nil { 292 fake.getLastSavepointReturnsOnCall = make(map[int]struct { 293 result1 *version.Height 294 result2 error 295 }) 296 } 297 fake.getLastSavepointReturnsOnCall[i] = struct { 298 result1 *version.Height 299 result2 error 300 }{result1, result2} 301 } 302 303 func (fake *TxMgr) Name() string { 304 fake.nameMutex.Lock() 305 ret, specificReturn := fake.nameReturnsOnCall[len(fake.nameArgsForCall)] 306 fake.nameArgsForCall = append(fake.nameArgsForCall, struct { 307 }{}) 308 fake.recordInvocation("Name", []interface{}{}) 309 fake.nameMutex.Unlock() 310 if fake.NameStub != nil { 311 return fake.NameStub() 312 } 313 if specificReturn { 314 return ret.result1 315 } 316 fakeReturns := fake.nameReturns 317 return fakeReturns.result1 318 } 319 320 func (fake *TxMgr) NameCallCount() int { 321 fake.nameMutex.RLock() 322 defer fake.nameMutex.RUnlock() 323 return len(fake.nameArgsForCall) 324 } 325 326 func (fake *TxMgr) NameCalls(stub func() string) { 327 fake.nameMutex.Lock() 328 defer fake.nameMutex.Unlock() 329 fake.NameStub = stub 330 } 331 332 func (fake *TxMgr) NameReturns(result1 string) { 333 fake.nameMutex.Lock() 334 defer fake.nameMutex.Unlock() 335 fake.NameStub = nil 336 fake.nameReturns = struct { 337 result1 string 338 }{result1} 339 } 340 341 func (fake *TxMgr) NameReturnsOnCall(i int, result1 string) { 342 fake.nameMutex.Lock() 343 defer fake.nameMutex.Unlock() 344 fake.NameStub = nil 345 if fake.nameReturnsOnCall == nil { 346 fake.nameReturnsOnCall = make(map[int]struct { 347 result1 string 348 }) 349 } 350 fake.nameReturnsOnCall[i] = struct { 351 result1 string 352 }{result1} 353 } 354 355 func (fake *TxMgr) NewQueryExecutor(arg1 string) (ledger.QueryExecutor, error) { 356 fake.newQueryExecutorMutex.Lock() 357 ret, specificReturn := fake.newQueryExecutorReturnsOnCall[len(fake.newQueryExecutorArgsForCall)] 358 fake.newQueryExecutorArgsForCall = append(fake.newQueryExecutorArgsForCall, struct { 359 arg1 string 360 }{arg1}) 361 fake.recordInvocation("NewQueryExecutor", []interface{}{arg1}) 362 fake.newQueryExecutorMutex.Unlock() 363 if fake.NewQueryExecutorStub != nil { 364 return fake.NewQueryExecutorStub(arg1) 365 } 366 if specificReturn { 367 return ret.result1, ret.result2 368 } 369 fakeReturns := fake.newQueryExecutorReturns 370 return fakeReturns.result1, fakeReturns.result2 371 } 372 373 func (fake *TxMgr) NewQueryExecutorCallCount() int { 374 fake.newQueryExecutorMutex.RLock() 375 defer fake.newQueryExecutorMutex.RUnlock() 376 return len(fake.newQueryExecutorArgsForCall) 377 } 378 379 func (fake *TxMgr) NewQueryExecutorCalls(stub func(string) (ledger.QueryExecutor, error)) { 380 fake.newQueryExecutorMutex.Lock() 381 defer fake.newQueryExecutorMutex.Unlock() 382 fake.NewQueryExecutorStub = stub 383 } 384 385 func (fake *TxMgr) NewQueryExecutorArgsForCall(i int) string { 386 fake.newQueryExecutorMutex.RLock() 387 defer fake.newQueryExecutorMutex.RUnlock() 388 argsForCall := fake.newQueryExecutorArgsForCall[i] 389 return argsForCall.arg1 390 } 391 392 func (fake *TxMgr) NewQueryExecutorReturns(result1 ledger.QueryExecutor, result2 error) { 393 fake.newQueryExecutorMutex.Lock() 394 defer fake.newQueryExecutorMutex.Unlock() 395 fake.NewQueryExecutorStub = nil 396 fake.newQueryExecutorReturns = struct { 397 result1 ledger.QueryExecutor 398 result2 error 399 }{result1, result2} 400 } 401 402 func (fake *TxMgr) NewQueryExecutorReturnsOnCall(i int, result1 ledger.QueryExecutor, result2 error) { 403 fake.newQueryExecutorMutex.Lock() 404 defer fake.newQueryExecutorMutex.Unlock() 405 fake.NewQueryExecutorStub = nil 406 if fake.newQueryExecutorReturnsOnCall == nil { 407 fake.newQueryExecutorReturnsOnCall = make(map[int]struct { 408 result1 ledger.QueryExecutor 409 result2 error 410 }) 411 } 412 fake.newQueryExecutorReturnsOnCall[i] = struct { 413 result1 ledger.QueryExecutor 414 result2 error 415 }{result1, result2} 416 } 417 418 func (fake *TxMgr) NewTxSimulator(arg1 string) (ledger.TxSimulator, error) { 419 fake.newTxSimulatorMutex.Lock() 420 ret, specificReturn := fake.newTxSimulatorReturnsOnCall[len(fake.newTxSimulatorArgsForCall)] 421 fake.newTxSimulatorArgsForCall = append(fake.newTxSimulatorArgsForCall, struct { 422 arg1 string 423 }{arg1}) 424 fake.recordInvocation("NewTxSimulator", []interface{}{arg1}) 425 fake.newTxSimulatorMutex.Unlock() 426 if fake.NewTxSimulatorStub != nil { 427 return fake.NewTxSimulatorStub(arg1) 428 } 429 if specificReturn { 430 return ret.result1, ret.result2 431 } 432 fakeReturns := fake.newTxSimulatorReturns 433 return fakeReturns.result1, fakeReturns.result2 434 } 435 436 func (fake *TxMgr) NewTxSimulatorCallCount() int { 437 fake.newTxSimulatorMutex.RLock() 438 defer fake.newTxSimulatorMutex.RUnlock() 439 return len(fake.newTxSimulatorArgsForCall) 440 } 441 442 func (fake *TxMgr) NewTxSimulatorCalls(stub func(string) (ledger.TxSimulator, error)) { 443 fake.newTxSimulatorMutex.Lock() 444 defer fake.newTxSimulatorMutex.Unlock() 445 fake.NewTxSimulatorStub = stub 446 } 447 448 func (fake *TxMgr) NewTxSimulatorArgsForCall(i int) string { 449 fake.newTxSimulatorMutex.RLock() 450 defer fake.newTxSimulatorMutex.RUnlock() 451 argsForCall := fake.newTxSimulatorArgsForCall[i] 452 return argsForCall.arg1 453 } 454 455 func (fake *TxMgr) NewTxSimulatorReturns(result1 ledger.TxSimulator, result2 error) { 456 fake.newTxSimulatorMutex.Lock() 457 defer fake.newTxSimulatorMutex.Unlock() 458 fake.NewTxSimulatorStub = nil 459 fake.newTxSimulatorReturns = struct { 460 result1 ledger.TxSimulator 461 result2 error 462 }{result1, result2} 463 } 464 465 func (fake *TxMgr) NewTxSimulatorReturnsOnCall(i int, result1 ledger.TxSimulator, result2 error) { 466 fake.newTxSimulatorMutex.Lock() 467 defer fake.newTxSimulatorMutex.Unlock() 468 fake.NewTxSimulatorStub = nil 469 if fake.newTxSimulatorReturnsOnCall == nil { 470 fake.newTxSimulatorReturnsOnCall = make(map[int]struct { 471 result1 ledger.TxSimulator 472 result2 error 473 }) 474 } 475 fake.newTxSimulatorReturnsOnCall[i] = struct { 476 result1 ledger.TxSimulator 477 result2 error 478 }{result1, result2} 479 } 480 481 func (fake *TxMgr) RemoveStaleAndCommitPvtDataOfOldBlocks(arg1 map[uint64][]*ledger.TxPvtData) error { 482 fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Lock() 483 ret, specificReturn := fake.removeStaleAndCommitPvtDataOfOldBlocksReturnsOnCall[len(fake.removeStaleAndCommitPvtDataOfOldBlocksArgsForCall)] 484 fake.removeStaleAndCommitPvtDataOfOldBlocksArgsForCall = append(fake.removeStaleAndCommitPvtDataOfOldBlocksArgsForCall, struct { 485 arg1 map[uint64][]*ledger.TxPvtData 486 }{arg1}) 487 fake.recordInvocation("RemoveStaleAndCommitPvtDataOfOldBlocks", []interface{}{arg1}) 488 fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Unlock() 489 if fake.RemoveStaleAndCommitPvtDataOfOldBlocksStub != nil { 490 return fake.RemoveStaleAndCommitPvtDataOfOldBlocksStub(arg1) 491 } 492 if specificReturn { 493 return ret.result1 494 } 495 fakeReturns := fake.removeStaleAndCommitPvtDataOfOldBlocksReturns 496 return fakeReturns.result1 497 } 498 499 func (fake *TxMgr) RemoveStaleAndCommitPvtDataOfOldBlocksCallCount() int { 500 fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.RLock() 501 defer fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.RUnlock() 502 return len(fake.removeStaleAndCommitPvtDataOfOldBlocksArgsForCall) 503 } 504 505 func (fake *TxMgr) RemoveStaleAndCommitPvtDataOfOldBlocksCalls(stub func(map[uint64][]*ledger.TxPvtData) error) { 506 fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Lock() 507 defer fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Unlock() 508 fake.RemoveStaleAndCommitPvtDataOfOldBlocksStub = stub 509 } 510 511 func (fake *TxMgr) RemoveStaleAndCommitPvtDataOfOldBlocksArgsForCall(i int) map[uint64][]*ledger.TxPvtData { 512 fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.RLock() 513 defer fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.RUnlock() 514 argsForCall := fake.removeStaleAndCommitPvtDataOfOldBlocksArgsForCall[i] 515 return argsForCall.arg1 516 } 517 518 func (fake *TxMgr) RemoveStaleAndCommitPvtDataOfOldBlocksReturns(result1 error) { 519 fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Lock() 520 defer fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Unlock() 521 fake.RemoveStaleAndCommitPvtDataOfOldBlocksStub = nil 522 fake.removeStaleAndCommitPvtDataOfOldBlocksReturns = struct { 523 result1 error 524 }{result1} 525 } 526 527 func (fake *TxMgr) RemoveStaleAndCommitPvtDataOfOldBlocksReturnsOnCall(i int, result1 error) { 528 fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Lock() 529 defer fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Unlock() 530 fake.RemoveStaleAndCommitPvtDataOfOldBlocksStub = nil 531 if fake.removeStaleAndCommitPvtDataOfOldBlocksReturnsOnCall == nil { 532 fake.removeStaleAndCommitPvtDataOfOldBlocksReturnsOnCall = make(map[int]struct { 533 result1 error 534 }) 535 } 536 fake.removeStaleAndCommitPvtDataOfOldBlocksReturnsOnCall[i] = struct { 537 result1 error 538 }{result1} 539 } 540 541 func (fake *TxMgr) Rollback() { 542 fake.rollbackMutex.Lock() 543 fake.rollbackArgsForCall = append(fake.rollbackArgsForCall, struct { 544 }{}) 545 fake.recordInvocation("Rollback", []interface{}{}) 546 fake.rollbackMutex.Unlock() 547 if fake.RollbackStub != nil { 548 fake.RollbackStub() 549 } 550 } 551 552 func (fake *TxMgr) RollbackCallCount() int { 553 fake.rollbackMutex.RLock() 554 defer fake.rollbackMutex.RUnlock() 555 return len(fake.rollbackArgsForCall) 556 } 557 558 func (fake *TxMgr) RollbackCalls(stub func()) { 559 fake.rollbackMutex.Lock() 560 defer fake.rollbackMutex.Unlock() 561 fake.RollbackStub = stub 562 } 563 564 func (fake *TxMgr) ShouldRecover(arg1 uint64) (bool, uint64, error) { 565 fake.shouldRecoverMutex.Lock() 566 ret, specificReturn := fake.shouldRecoverReturnsOnCall[len(fake.shouldRecoverArgsForCall)] 567 fake.shouldRecoverArgsForCall = append(fake.shouldRecoverArgsForCall, struct { 568 arg1 uint64 569 }{arg1}) 570 fake.recordInvocation("ShouldRecover", []interface{}{arg1}) 571 fake.shouldRecoverMutex.Unlock() 572 if fake.ShouldRecoverStub != nil { 573 return fake.ShouldRecoverStub(arg1) 574 } 575 if specificReturn { 576 return ret.result1, ret.result2, ret.result3 577 } 578 fakeReturns := fake.shouldRecoverReturns 579 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 580 } 581 582 func (fake *TxMgr) ShouldRecoverCallCount() int { 583 fake.shouldRecoverMutex.RLock() 584 defer fake.shouldRecoverMutex.RUnlock() 585 return len(fake.shouldRecoverArgsForCall) 586 } 587 588 func (fake *TxMgr) ShouldRecoverCalls(stub func(uint64) (bool, uint64, error)) { 589 fake.shouldRecoverMutex.Lock() 590 defer fake.shouldRecoverMutex.Unlock() 591 fake.ShouldRecoverStub = stub 592 } 593 594 func (fake *TxMgr) ShouldRecoverArgsForCall(i int) uint64 { 595 fake.shouldRecoverMutex.RLock() 596 defer fake.shouldRecoverMutex.RUnlock() 597 argsForCall := fake.shouldRecoverArgsForCall[i] 598 return argsForCall.arg1 599 } 600 601 func (fake *TxMgr) ShouldRecoverReturns(result1 bool, result2 uint64, result3 error) { 602 fake.shouldRecoverMutex.Lock() 603 defer fake.shouldRecoverMutex.Unlock() 604 fake.ShouldRecoverStub = nil 605 fake.shouldRecoverReturns = struct { 606 result1 bool 607 result2 uint64 608 result3 error 609 }{result1, result2, result3} 610 } 611 612 func (fake *TxMgr) ShouldRecoverReturnsOnCall(i int, result1 bool, result2 uint64, result3 error) { 613 fake.shouldRecoverMutex.Lock() 614 defer fake.shouldRecoverMutex.Unlock() 615 fake.ShouldRecoverStub = nil 616 if fake.shouldRecoverReturnsOnCall == nil { 617 fake.shouldRecoverReturnsOnCall = make(map[int]struct { 618 result1 bool 619 result2 uint64 620 result3 error 621 }) 622 } 623 fake.shouldRecoverReturnsOnCall[i] = struct { 624 result1 bool 625 result2 uint64 626 result3 error 627 }{result1, result2, result3} 628 } 629 630 func (fake *TxMgr) Shutdown() { 631 fake.shutdownMutex.Lock() 632 fake.shutdownArgsForCall = append(fake.shutdownArgsForCall, struct { 633 }{}) 634 fake.recordInvocation("Shutdown", []interface{}{}) 635 fake.shutdownMutex.Unlock() 636 if fake.ShutdownStub != nil { 637 fake.ShutdownStub() 638 } 639 } 640 641 func (fake *TxMgr) ShutdownCallCount() int { 642 fake.shutdownMutex.RLock() 643 defer fake.shutdownMutex.RUnlock() 644 return len(fake.shutdownArgsForCall) 645 } 646 647 func (fake *TxMgr) ShutdownCalls(stub func()) { 648 fake.shutdownMutex.Lock() 649 defer fake.shutdownMutex.Unlock() 650 fake.ShutdownStub = stub 651 } 652 653 func (fake *TxMgr) ValidateAndPrepare(arg1 *ledger.BlockAndPvtData, arg2 bool) ([]*txmgr.TxStatInfo, []byte, error) { 654 fake.validateAndPrepareMutex.Lock() 655 ret, specificReturn := fake.validateAndPrepareReturnsOnCall[len(fake.validateAndPrepareArgsForCall)] 656 fake.validateAndPrepareArgsForCall = append(fake.validateAndPrepareArgsForCall, struct { 657 arg1 *ledger.BlockAndPvtData 658 arg2 bool 659 }{arg1, arg2}) 660 fake.recordInvocation("ValidateAndPrepare", []interface{}{arg1, arg2}) 661 fake.validateAndPrepareMutex.Unlock() 662 if fake.ValidateAndPrepareStub != nil { 663 return fake.ValidateAndPrepareStub(arg1, arg2) 664 } 665 if specificReturn { 666 return ret.result1, ret.result2, ret.result3 667 } 668 fakeReturns := fake.validateAndPrepareReturns 669 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 670 } 671 672 func (fake *TxMgr) ValidateAndPrepareCallCount() int { 673 fake.validateAndPrepareMutex.RLock() 674 defer fake.validateAndPrepareMutex.RUnlock() 675 return len(fake.validateAndPrepareArgsForCall) 676 } 677 678 func (fake *TxMgr) ValidateAndPrepareCalls(stub func(*ledger.BlockAndPvtData, bool) ([]*txmgr.TxStatInfo, []byte, error)) { 679 fake.validateAndPrepareMutex.Lock() 680 defer fake.validateAndPrepareMutex.Unlock() 681 fake.ValidateAndPrepareStub = stub 682 } 683 684 func (fake *TxMgr) ValidateAndPrepareArgsForCall(i int) (*ledger.BlockAndPvtData, bool) { 685 fake.validateAndPrepareMutex.RLock() 686 defer fake.validateAndPrepareMutex.RUnlock() 687 argsForCall := fake.validateAndPrepareArgsForCall[i] 688 return argsForCall.arg1, argsForCall.arg2 689 } 690 691 func (fake *TxMgr) ValidateAndPrepareReturns(result1 []*txmgr.TxStatInfo, result2 []byte, result3 error) { 692 fake.validateAndPrepareMutex.Lock() 693 defer fake.validateAndPrepareMutex.Unlock() 694 fake.ValidateAndPrepareStub = nil 695 fake.validateAndPrepareReturns = struct { 696 result1 []*txmgr.TxStatInfo 697 result2 []byte 698 result3 error 699 }{result1, result2, result3} 700 } 701 702 func (fake *TxMgr) ValidateAndPrepareReturnsOnCall(i int, result1 []*txmgr.TxStatInfo, result2 []byte, result3 error) { 703 fake.validateAndPrepareMutex.Lock() 704 defer fake.validateAndPrepareMutex.Unlock() 705 fake.ValidateAndPrepareStub = nil 706 if fake.validateAndPrepareReturnsOnCall == nil { 707 fake.validateAndPrepareReturnsOnCall = make(map[int]struct { 708 result1 []*txmgr.TxStatInfo 709 result2 []byte 710 result3 error 711 }) 712 } 713 fake.validateAndPrepareReturnsOnCall[i] = struct { 714 result1 []*txmgr.TxStatInfo 715 result2 []byte 716 result3 error 717 }{result1, result2, result3} 718 } 719 720 func (fake *TxMgr) Invocations() map[string][][]interface{} { 721 fake.invocationsMutex.RLock() 722 defer fake.invocationsMutex.RUnlock() 723 fake.commitMutex.RLock() 724 defer fake.commitMutex.RUnlock() 725 fake.commitLostBlockMutex.RLock() 726 defer fake.commitLostBlockMutex.RUnlock() 727 fake.getLastSavepointMutex.RLock() 728 defer fake.getLastSavepointMutex.RUnlock() 729 fake.nameMutex.RLock() 730 defer fake.nameMutex.RUnlock() 731 fake.newQueryExecutorMutex.RLock() 732 defer fake.newQueryExecutorMutex.RUnlock() 733 fake.newTxSimulatorMutex.RLock() 734 defer fake.newTxSimulatorMutex.RUnlock() 735 fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.RLock() 736 defer fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.RUnlock() 737 fake.rollbackMutex.RLock() 738 defer fake.rollbackMutex.RUnlock() 739 fake.shouldRecoverMutex.RLock() 740 defer fake.shouldRecoverMutex.RUnlock() 741 fake.shutdownMutex.RLock() 742 defer fake.shutdownMutex.RUnlock() 743 fake.validateAndPrepareMutex.RLock() 744 defer fake.validateAndPrepareMutex.RUnlock() 745 copiedInvocations := map[string][][]interface{}{} 746 for key, value := range fake.invocations { 747 copiedInvocations[key] = value 748 } 749 return copiedInvocations 750 } 751 752 func (fake *TxMgr) recordInvocation(key string, args []interface{}) { 753 fake.invocationsMutex.Lock() 754 defer fake.invocationsMutex.Unlock() 755 if fake.invocations == nil { 756 fake.invocations = map[string][][]interface{}{} 757 } 758 if fake.invocations[key] == nil { 759 fake.invocations[key] = [][]interface{}{} 760 } 761 fake.invocations[key] = append(fake.invocations[key], args) 762 } 763 764 var _ txmgr.TxMgr = new(TxMgr)