github.com/hyperledger-labs/bdls@v2.1.1+incompatible/core/chaincode/mock/peer_ledger.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mock 3 4 import ( 5 "sync" 6 7 "github.com/hyperledger/fabric-protos-go/common" 8 "github.com/hyperledger/fabric-protos-go/peer" 9 ledgera "github.com/hyperledger/fabric/common/ledger" 10 "github.com/hyperledger/fabric/core/ledger" 11 ) 12 13 type PeerLedger struct { 14 CloseStub func() 15 closeMutex sync.RWMutex 16 closeArgsForCall []struct { 17 } 18 CommitLegacyStub func(*ledger.BlockAndPvtData, *ledger.CommitOptions) error 19 commitLegacyMutex sync.RWMutex 20 commitLegacyArgsForCall []struct { 21 arg1 *ledger.BlockAndPvtData 22 arg2 *ledger.CommitOptions 23 } 24 commitLegacyReturns struct { 25 result1 error 26 } 27 commitLegacyReturnsOnCall map[int]struct { 28 result1 error 29 } 30 CommitPvtDataOfOldBlocksStub func([]*ledger.ReconciledPvtdata) ([]*ledger.PvtdataHashMismatch, error) 31 commitPvtDataOfOldBlocksMutex sync.RWMutex 32 commitPvtDataOfOldBlocksArgsForCall []struct { 33 arg1 []*ledger.ReconciledPvtdata 34 } 35 commitPvtDataOfOldBlocksReturns struct { 36 result1 []*ledger.PvtdataHashMismatch 37 result2 error 38 } 39 commitPvtDataOfOldBlocksReturnsOnCall map[int]struct { 40 result1 []*ledger.PvtdataHashMismatch 41 result2 error 42 } 43 DoesPvtDataInfoExistStub func(uint64) (bool, error) 44 doesPvtDataInfoExistMutex sync.RWMutex 45 doesPvtDataInfoExistArgsForCall []struct { 46 arg1 uint64 47 } 48 doesPvtDataInfoExistReturns struct { 49 result1 bool 50 result2 error 51 } 52 doesPvtDataInfoExistReturnsOnCall map[int]struct { 53 result1 bool 54 result2 error 55 } 56 GetBlockByHashStub func([]byte) (*common.Block, error) 57 getBlockByHashMutex sync.RWMutex 58 getBlockByHashArgsForCall []struct { 59 arg1 []byte 60 } 61 getBlockByHashReturns struct { 62 result1 *common.Block 63 result2 error 64 } 65 getBlockByHashReturnsOnCall map[int]struct { 66 result1 *common.Block 67 result2 error 68 } 69 GetBlockByNumberStub func(uint64) (*common.Block, error) 70 getBlockByNumberMutex sync.RWMutex 71 getBlockByNumberArgsForCall []struct { 72 arg1 uint64 73 } 74 getBlockByNumberReturns struct { 75 result1 *common.Block 76 result2 error 77 } 78 getBlockByNumberReturnsOnCall map[int]struct { 79 result1 *common.Block 80 result2 error 81 } 82 GetBlockByTxIDStub func(string) (*common.Block, error) 83 getBlockByTxIDMutex sync.RWMutex 84 getBlockByTxIDArgsForCall []struct { 85 arg1 string 86 } 87 getBlockByTxIDReturns struct { 88 result1 *common.Block 89 result2 error 90 } 91 getBlockByTxIDReturnsOnCall map[int]struct { 92 result1 *common.Block 93 result2 error 94 } 95 GetBlockchainInfoStub func() (*common.BlockchainInfo, error) 96 getBlockchainInfoMutex sync.RWMutex 97 getBlockchainInfoArgsForCall []struct { 98 } 99 getBlockchainInfoReturns struct { 100 result1 *common.BlockchainInfo 101 result2 error 102 } 103 getBlockchainInfoReturnsOnCall map[int]struct { 104 result1 *common.BlockchainInfo 105 result2 error 106 } 107 GetBlocksIteratorStub func(uint64) (ledgera.ResultsIterator, error) 108 getBlocksIteratorMutex sync.RWMutex 109 getBlocksIteratorArgsForCall []struct { 110 arg1 uint64 111 } 112 getBlocksIteratorReturns struct { 113 result1 ledgera.ResultsIterator 114 result2 error 115 } 116 getBlocksIteratorReturnsOnCall map[int]struct { 117 result1 ledgera.ResultsIterator 118 result2 error 119 } 120 GetConfigHistoryRetrieverStub func() (ledger.ConfigHistoryRetriever, error) 121 getConfigHistoryRetrieverMutex sync.RWMutex 122 getConfigHistoryRetrieverArgsForCall []struct { 123 } 124 getConfigHistoryRetrieverReturns struct { 125 result1 ledger.ConfigHistoryRetriever 126 result2 error 127 } 128 getConfigHistoryRetrieverReturnsOnCall map[int]struct { 129 result1 ledger.ConfigHistoryRetriever 130 result2 error 131 } 132 GetMissingPvtDataTrackerStub func() (ledger.MissingPvtDataTracker, error) 133 getMissingPvtDataTrackerMutex sync.RWMutex 134 getMissingPvtDataTrackerArgsForCall []struct { 135 } 136 getMissingPvtDataTrackerReturns struct { 137 result1 ledger.MissingPvtDataTracker 138 result2 error 139 } 140 getMissingPvtDataTrackerReturnsOnCall map[int]struct { 141 result1 ledger.MissingPvtDataTracker 142 result2 error 143 } 144 GetPvtDataAndBlockByNumStub func(uint64, ledger.PvtNsCollFilter) (*ledger.BlockAndPvtData, error) 145 getPvtDataAndBlockByNumMutex sync.RWMutex 146 getPvtDataAndBlockByNumArgsForCall []struct { 147 arg1 uint64 148 arg2 ledger.PvtNsCollFilter 149 } 150 getPvtDataAndBlockByNumReturns struct { 151 result1 *ledger.BlockAndPvtData 152 result2 error 153 } 154 getPvtDataAndBlockByNumReturnsOnCall map[int]struct { 155 result1 *ledger.BlockAndPvtData 156 result2 error 157 } 158 GetPvtDataByNumStub func(uint64, ledger.PvtNsCollFilter) ([]*ledger.TxPvtData, error) 159 getPvtDataByNumMutex sync.RWMutex 160 getPvtDataByNumArgsForCall []struct { 161 arg1 uint64 162 arg2 ledger.PvtNsCollFilter 163 } 164 getPvtDataByNumReturns struct { 165 result1 []*ledger.TxPvtData 166 result2 error 167 } 168 getPvtDataByNumReturnsOnCall map[int]struct { 169 result1 []*ledger.TxPvtData 170 result2 error 171 } 172 GetTransactionByIDStub func(string) (*peer.ProcessedTransaction, error) 173 getTransactionByIDMutex sync.RWMutex 174 getTransactionByIDArgsForCall []struct { 175 arg1 string 176 } 177 getTransactionByIDReturns struct { 178 result1 *peer.ProcessedTransaction 179 result2 error 180 } 181 getTransactionByIDReturnsOnCall map[int]struct { 182 result1 *peer.ProcessedTransaction 183 result2 error 184 } 185 GetTxValidationCodeByTxIDStub func(string) (peer.TxValidationCode, error) 186 getTxValidationCodeByTxIDMutex sync.RWMutex 187 getTxValidationCodeByTxIDArgsForCall []struct { 188 arg1 string 189 } 190 getTxValidationCodeByTxIDReturns struct { 191 result1 peer.TxValidationCode 192 result2 error 193 } 194 getTxValidationCodeByTxIDReturnsOnCall map[int]struct { 195 result1 peer.TxValidationCode 196 result2 error 197 } 198 NewHistoryQueryExecutorStub func() (ledger.HistoryQueryExecutor, error) 199 newHistoryQueryExecutorMutex sync.RWMutex 200 newHistoryQueryExecutorArgsForCall []struct { 201 } 202 newHistoryQueryExecutorReturns struct { 203 result1 ledger.HistoryQueryExecutor 204 result2 error 205 } 206 newHistoryQueryExecutorReturnsOnCall map[int]struct { 207 result1 ledger.HistoryQueryExecutor 208 result2 error 209 } 210 NewQueryExecutorStub func() (ledger.QueryExecutor, error) 211 newQueryExecutorMutex sync.RWMutex 212 newQueryExecutorArgsForCall []struct { 213 } 214 newQueryExecutorReturns struct { 215 result1 ledger.QueryExecutor 216 result2 error 217 } 218 newQueryExecutorReturnsOnCall map[int]struct { 219 result1 ledger.QueryExecutor 220 result2 error 221 } 222 NewTxSimulatorStub func(string) (ledger.TxSimulator, error) 223 newTxSimulatorMutex sync.RWMutex 224 newTxSimulatorArgsForCall []struct { 225 arg1 string 226 } 227 newTxSimulatorReturns struct { 228 result1 ledger.TxSimulator 229 result2 error 230 } 231 newTxSimulatorReturnsOnCall map[int]struct { 232 result1 ledger.TxSimulator 233 result2 error 234 } 235 invocations map[string][][]interface{} 236 invocationsMutex sync.RWMutex 237 } 238 239 func (fake *PeerLedger) Close() { 240 fake.closeMutex.Lock() 241 fake.closeArgsForCall = append(fake.closeArgsForCall, struct { 242 }{}) 243 fake.recordInvocation("Close", []interface{}{}) 244 fake.closeMutex.Unlock() 245 if fake.CloseStub != nil { 246 fake.CloseStub() 247 } 248 } 249 250 func (fake *PeerLedger) CloseCallCount() int { 251 fake.closeMutex.RLock() 252 defer fake.closeMutex.RUnlock() 253 return len(fake.closeArgsForCall) 254 } 255 256 func (fake *PeerLedger) CloseCalls(stub func()) { 257 fake.closeMutex.Lock() 258 defer fake.closeMutex.Unlock() 259 fake.CloseStub = stub 260 } 261 262 func (fake *PeerLedger) CommitLegacy(arg1 *ledger.BlockAndPvtData, arg2 *ledger.CommitOptions) error { 263 fake.commitLegacyMutex.Lock() 264 ret, specificReturn := fake.commitLegacyReturnsOnCall[len(fake.commitLegacyArgsForCall)] 265 fake.commitLegacyArgsForCall = append(fake.commitLegacyArgsForCall, struct { 266 arg1 *ledger.BlockAndPvtData 267 arg2 *ledger.CommitOptions 268 }{arg1, arg2}) 269 fake.recordInvocation("CommitLegacy", []interface{}{arg1, arg2}) 270 fake.commitLegacyMutex.Unlock() 271 if fake.CommitLegacyStub != nil { 272 return fake.CommitLegacyStub(arg1, arg2) 273 } 274 if specificReturn { 275 return ret.result1 276 } 277 fakeReturns := fake.commitLegacyReturns 278 return fakeReturns.result1 279 } 280 281 func (fake *PeerLedger) CommitLegacyCallCount() int { 282 fake.commitLegacyMutex.RLock() 283 defer fake.commitLegacyMutex.RUnlock() 284 return len(fake.commitLegacyArgsForCall) 285 } 286 287 func (fake *PeerLedger) CommitLegacyCalls(stub func(*ledger.BlockAndPvtData, *ledger.CommitOptions) error) { 288 fake.commitLegacyMutex.Lock() 289 defer fake.commitLegacyMutex.Unlock() 290 fake.CommitLegacyStub = stub 291 } 292 293 func (fake *PeerLedger) CommitLegacyArgsForCall(i int) (*ledger.BlockAndPvtData, *ledger.CommitOptions) { 294 fake.commitLegacyMutex.RLock() 295 defer fake.commitLegacyMutex.RUnlock() 296 argsForCall := fake.commitLegacyArgsForCall[i] 297 return argsForCall.arg1, argsForCall.arg2 298 } 299 300 func (fake *PeerLedger) CommitLegacyReturns(result1 error) { 301 fake.commitLegacyMutex.Lock() 302 defer fake.commitLegacyMutex.Unlock() 303 fake.CommitLegacyStub = nil 304 fake.commitLegacyReturns = struct { 305 result1 error 306 }{result1} 307 } 308 309 func (fake *PeerLedger) CommitLegacyReturnsOnCall(i int, result1 error) { 310 fake.commitLegacyMutex.Lock() 311 defer fake.commitLegacyMutex.Unlock() 312 fake.CommitLegacyStub = nil 313 if fake.commitLegacyReturnsOnCall == nil { 314 fake.commitLegacyReturnsOnCall = make(map[int]struct { 315 result1 error 316 }) 317 } 318 fake.commitLegacyReturnsOnCall[i] = struct { 319 result1 error 320 }{result1} 321 } 322 323 func (fake *PeerLedger) CommitPvtDataOfOldBlocks(arg1 []*ledger.ReconciledPvtdata) ([]*ledger.PvtdataHashMismatch, error) { 324 var arg1Copy []*ledger.ReconciledPvtdata 325 if arg1 != nil { 326 arg1Copy = make([]*ledger.ReconciledPvtdata, len(arg1)) 327 copy(arg1Copy, arg1) 328 } 329 fake.commitPvtDataOfOldBlocksMutex.Lock() 330 ret, specificReturn := fake.commitPvtDataOfOldBlocksReturnsOnCall[len(fake.commitPvtDataOfOldBlocksArgsForCall)] 331 fake.commitPvtDataOfOldBlocksArgsForCall = append(fake.commitPvtDataOfOldBlocksArgsForCall, struct { 332 arg1 []*ledger.ReconciledPvtdata 333 }{arg1Copy}) 334 fake.recordInvocation("CommitPvtDataOfOldBlocks", []interface{}{arg1Copy}) 335 fake.commitPvtDataOfOldBlocksMutex.Unlock() 336 if fake.CommitPvtDataOfOldBlocksStub != nil { 337 return fake.CommitPvtDataOfOldBlocksStub(arg1) 338 } 339 if specificReturn { 340 return ret.result1, ret.result2 341 } 342 fakeReturns := fake.commitPvtDataOfOldBlocksReturns 343 return fakeReturns.result1, fakeReturns.result2 344 } 345 346 func (fake *PeerLedger) CommitPvtDataOfOldBlocksCallCount() int { 347 fake.commitPvtDataOfOldBlocksMutex.RLock() 348 defer fake.commitPvtDataOfOldBlocksMutex.RUnlock() 349 return len(fake.commitPvtDataOfOldBlocksArgsForCall) 350 } 351 352 func (fake *PeerLedger) CommitPvtDataOfOldBlocksCalls(stub func([]*ledger.ReconciledPvtdata) ([]*ledger.PvtdataHashMismatch, error)) { 353 fake.commitPvtDataOfOldBlocksMutex.Lock() 354 defer fake.commitPvtDataOfOldBlocksMutex.Unlock() 355 fake.CommitPvtDataOfOldBlocksStub = stub 356 } 357 358 func (fake *PeerLedger) CommitPvtDataOfOldBlocksArgsForCall(i int) []*ledger.ReconciledPvtdata { 359 fake.commitPvtDataOfOldBlocksMutex.RLock() 360 defer fake.commitPvtDataOfOldBlocksMutex.RUnlock() 361 argsForCall := fake.commitPvtDataOfOldBlocksArgsForCall[i] 362 return argsForCall.arg1 363 } 364 365 func (fake *PeerLedger) CommitPvtDataOfOldBlocksReturns(result1 []*ledger.PvtdataHashMismatch, result2 error) { 366 fake.commitPvtDataOfOldBlocksMutex.Lock() 367 defer fake.commitPvtDataOfOldBlocksMutex.Unlock() 368 fake.CommitPvtDataOfOldBlocksStub = nil 369 fake.commitPvtDataOfOldBlocksReturns = struct { 370 result1 []*ledger.PvtdataHashMismatch 371 result2 error 372 }{result1, result2} 373 } 374 375 func (fake *PeerLedger) CommitPvtDataOfOldBlocksReturnsOnCall(i int, result1 []*ledger.PvtdataHashMismatch, result2 error) { 376 fake.commitPvtDataOfOldBlocksMutex.Lock() 377 defer fake.commitPvtDataOfOldBlocksMutex.Unlock() 378 fake.CommitPvtDataOfOldBlocksStub = nil 379 if fake.commitPvtDataOfOldBlocksReturnsOnCall == nil { 380 fake.commitPvtDataOfOldBlocksReturnsOnCall = make(map[int]struct { 381 result1 []*ledger.PvtdataHashMismatch 382 result2 error 383 }) 384 } 385 fake.commitPvtDataOfOldBlocksReturnsOnCall[i] = struct { 386 result1 []*ledger.PvtdataHashMismatch 387 result2 error 388 }{result1, result2} 389 } 390 391 func (fake *PeerLedger) DoesPvtDataInfoExist(arg1 uint64) (bool, error) { 392 fake.doesPvtDataInfoExistMutex.Lock() 393 ret, specificReturn := fake.doesPvtDataInfoExistReturnsOnCall[len(fake.doesPvtDataInfoExistArgsForCall)] 394 fake.doesPvtDataInfoExistArgsForCall = append(fake.doesPvtDataInfoExistArgsForCall, struct { 395 arg1 uint64 396 }{arg1}) 397 fake.recordInvocation("DoesPvtDataInfoExist", []interface{}{arg1}) 398 fake.doesPvtDataInfoExistMutex.Unlock() 399 if fake.DoesPvtDataInfoExistStub != nil { 400 return fake.DoesPvtDataInfoExistStub(arg1) 401 } 402 if specificReturn { 403 return ret.result1, ret.result2 404 } 405 fakeReturns := fake.doesPvtDataInfoExistReturns 406 return fakeReturns.result1, fakeReturns.result2 407 } 408 409 func (fake *PeerLedger) DoesPvtDataInfoExistCallCount() int { 410 fake.doesPvtDataInfoExistMutex.RLock() 411 defer fake.doesPvtDataInfoExistMutex.RUnlock() 412 return len(fake.doesPvtDataInfoExistArgsForCall) 413 } 414 415 func (fake *PeerLedger) DoesPvtDataInfoExistCalls(stub func(uint64) (bool, error)) { 416 fake.doesPvtDataInfoExistMutex.Lock() 417 defer fake.doesPvtDataInfoExistMutex.Unlock() 418 fake.DoesPvtDataInfoExistStub = stub 419 } 420 421 func (fake *PeerLedger) DoesPvtDataInfoExistArgsForCall(i int) uint64 { 422 fake.doesPvtDataInfoExistMutex.RLock() 423 defer fake.doesPvtDataInfoExistMutex.RUnlock() 424 argsForCall := fake.doesPvtDataInfoExistArgsForCall[i] 425 return argsForCall.arg1 426 } 427 428 func (fake *PeerLedger) DoesPvtDataInfoExistReturns(result1 bool, result2 error) { 429 fake.doesPvtDataInfoExistMutex.Lock() 430 defer fake.doesPvtDataInfoExistMutex.Unlock() 431 fake.DoesPvtDataInfoExistStub = nil 432 fake.doesPvtDataInfoExistReturns = struct { 433 result1 bool 434 result2 error 435 }{result1, result2} 436 } 437 438 func (fake *PeerLedger) DoesPvtDataInfoExistReturnsOnCall(i int, result1 bool, result2 error) { 439 fake.doesPvtDataInfoExistMutex.Lock() 440 defer fake.doesPvtDataInfoExistMutex.Unlock() 441 fake.DoesPvtDataInfoExistStub = nil 442 if fake.doesPvtDataInfoExistReturnsOnCall == nil { 443 fake.doesPvtDataInfoExistReturnsOnCall = make(map[int]struct { 444 result1 bool 445 result2 error 446 }) 447 } 448 fake.doesPvtDataInfoExistReturnsOnCall[i] = struct { 449 result1 bool 450 result2 error 451 }{result1, result2} 452 } 453 454 func (fake *PeerLedger) GetBlockByHash(arg1 []byte) (*common.Block, error) { 455 var arg1Copy []byte 456 if arg1 != nil { 457 arg1Copy = make([]byte, len(arg1)) 458 copy(arg1Copy, arg1) 459 } 460 fake.getBlockByHashMutex.Lock() 461 ret, specificReturn := fake.getBlockByHashReturnsOnCall[len(fake.getBlockByHashArgsForCall)] 462 fake.getBlockByHashArgsForCall = append(fake.getBlockByHashArgsForCall, struct { 463 arg1 []byte 464 }{arg1Copy}) 465 fake.recordInvocation("GetBlockByHash", []interface{}{arg1Copy}) 466 fake.getBlockByHashMutex.Unlock() 467 if fake.GetBlockByHashStub != nil { 468 return fake.GetBlockByHashStub(arg1) 469 } 470 if specificReturn { 471 return ret.result1, ret.result2 472 } 473 fakeReturns := fake.getBlockByHashReturns 474 return fakeReturns.result1, fakeReturns.result2 475 } 476 477 func (fake *PeerLedger) GetBlockByHashCallCount() int { 478 fake.getBlockByHashMutex.RLock() 479 defer fake.getBlockByHashMutex.RUnlock() 480 return len(fake.getBlockByHashArgsForCall) 481 } 482 483 func (fake *PeerLedger) GetBlockByHashCalls(stub func([]byte) (*common.Block, error)) { 484 fake.getBlockByHashMutex.Lock() 485 defer fake.getBlockByHashMutex.Unlock() 486 fake.GetBlockByHashStub = stub 487 } 488 489 func (fake *PeerLedger) GetBlockByHashArgsForCall(i int) []byte { 490 fake.getBlockByHashMutex.RLock() 491 defer fake.getBlockByHashMutex.RUnlock() 492 argsForCall := fake.getBlockByHashArgsForCall[i] 493 return argsForCall.arg1 494 } 495 496 func (fake *PeerLedger) GetBlockByHashReturns(result1 *common.Block, result2 error) { 497 fake.getBlockByHashMutex.Lock() 498 defer fake.getBlockByHashMutex.Unlock() 499 fake.GetBlockByHashStub = nil 500 fake.getBlockByHashReturns = struct { 501 result1 *common.Block 502 result2 error 503 }{result1, result2} 504 } 505 506 func (fake *PeerLedger) GetBlockByHashReturnsOnCall(i int, result1 *common.Block, result2 error) { 507 fake.getBlockByHashMutex.Lock() 508 defer fake.getBlockByHashMutex.Unlock() 509 fake.GetBlockByHashStub = nil 510 if fake.getBlockByHashReturnsOnCall == nil { 511 fake.getBlockByHashReturnsOnCall = make(map[int]struct { 512 result1 *common.Block 513 result2 error 514 }) 515 } 516 fake.getBlockByHashReturnsOnCall[i] = struct { 517 result1 *common.Block 518 result2 error 519 }{result1, result2} 520 } 521 522 func (fake *PeerLedger) GetBlockByNumber(arg1 uint64) (*common.Block, error) { 523 fake.getBlockByNumberMutex.Lock() 524 ret, specificReturn := fake.getBlockByNumberReturnsOnCall[len(fake.getBlockByNumberArgsForCall)] 525 fake.getBlockByNumberArgsForCall = append(fake.getBlockByNumberArgsForCall, struct { 526 arg1 uint64 527 }{arg1}) 528 fake.recordInvocation("GetBlockByNumber", []interface{}{arg1}) 529 fake.getBlockByNumberMutex.Unlock() 530 if fake.GetBlockByNumberStub != nil { 531 return fake.GetBlockByNumberStub(arg1) 532 } 533 if specificReturn { 534 return ret.result1, ret.result2 535 } 536 fakeReturns := fake.getBlockByNumberReturns 537 return fakeReturns.result1, fakeReturns.result2 538 } 539 540 func (fake *PeerLedger) GetBlockByNumberCallCount() int { 541 fake.getBlockByNumberMutex.RLock() 542 defer fake.getBlockByNumberMutex.RUnlock() 543 return len(fake.getBlockByNumberArgsForCall) 544 } 545 546 func (fake *PeerLedger) GetBlockByNumberCalls(stub func(uint64) (*common.Block, error)) { 547 fake.getBlockByNumberMutex.Lock() 548 defer fake.getBlockByNumberMutex.Unlock() 549 fake.GetBlockByNumberStub = stub 550 } 551 552 func (fake *PeerLedger) GetBlockByNumberArgsForCall(i int) uint64 { 553 fake.getBlockByNumberMutex.RLock() 554 defer fake.getBlockByNumberMutex.RUnlock() 555 argsForCall := fake.getBlockByNumberArgsForCall[i] 556 return argsForCall.arg1 557 } 558 559 func (fake *PeerLedger) GetBlockByNumberReturns(result1 *common.Block, result2 error) { 560 fake.getBlockByNumberMutex.Lock() 561 defer fake.getBlockByNumberMutex.Unlock() 562 fake.GetBlockByNumberStub = nil 563 fake.getBlockByNumberReturns = struct { 564 result1 *common.Block 565 result2 error 566 }{result1, result2} 567 } 568 569 func (fake *PeerLedger) GetBlockByNumberReturnsOnCall(i int, result1 *common.Block, result2 error) { 570 fake.getBlockByNumberMutex.Lock() 571 defer fake.getBlockByNumberMutex.Unlock() 572 fake.GetBlockByNumberStub = nil 573 if fake.getBlockByNumberReturnsOnCall == nil { 574 fake.getBlockByNumberReturnsOnCall = make(map[int]struct { 575 result1 *common.Block 576 result2 error 577 }) 578 } 579 fake.getBlockByNumberReturnsOnCall[i] = struct { 580 result1 *common.Block 581 result2 error 582 }{result1, result2} 583 } 584 585 func (fake *PeerLedger) GetBlockByTxID(arg1 string) (*common.Block, error) { 586 fake.getBlockByTxIDMutex.Lock() 587 ret, specificReturn := fake.getBlockByTxIDReturnsOnCall[len(fake.getBlockByTxIDArgsForCall)] 588 fake.getBlockByTxIDArgsForCall = append(fake.getBlockByTxIDArgsForCall, struct { 589 arg1 string 590 }{arg1}) 591 fake.recordInvocation("GetBlockByTxID", []interface{}{arg1}) 592 fake.getBlockByTxIDMutex.Unlock() 593 if fake.GetBlockByTxIDStub != nil { 594 return fake.GetBlockByTxIDStub(arg1) 595 } 596 if specificReturn { 597 return ret.result1, ret.result2 598 } 599 fakeReturns := fake.getBlockByTxIDReturns 600 return fakeReturns.result1, fakeReturns.result2 601 } 602 603 func (fake *PeerLedger) GetBlockByTxIDCallCount() int { 604 fake.getBlockByTxIDMutex.RLock() 605 defer fake.getBlockByTxIDMutex.RUnlock() 606 return len(fake.getBlockByTxIDArgsForCall) 607 } 608 609 func (fake *PeerLedger) GetBlockByTxIDCalls(stub func(string) (*common.Block, error)) { 610 fake.getBlockByTxIDMutex.Lock() 611 defer fake.getBlockByTxIDMutex.Unlock() 612 fake.GetBlockByTxIDStub = stub 613 } 614 615 func (fake *PeerLedger) GetBlockByTxIDArgsForCall(i int) string { 616 fake.getBlockByTxIDMutex.RLock() 617 defer fake.getBlockByTxIDMutex.RUnlock() 618 argsForCall := fake.getBlockByTxIDArgsForCall[i] 619 return argsForCall.arg1 620 } 621 622 func (fake *PeerLedger) GetBlockByTxIDReturns(result1 *common.Block, result2 error) { 623 fake.getBlockByTxIDMutex.Lock() 624 defer fake.getBlockByTxIDMutex.Unlock() 625 fake.GetBlockByTxIDStub = nil 626 fake.getBlockByTxIDReturns = struct { 627 result1 *common.Block 628 result2 error 629 }{result1, result2} 630 } 631 632 func (fake *PeerLedger) GetBlockByTxIDReturnsOnCall(i int, result1 *common.Block, result2 error) { 633 fake.getBlockByTxIDMutex.Lock() 634 defer fake.getBlockByTxIDMutex.Unlock() 635 fake.GetBlockByTxIDStub = nil 636 if fake.getBlockByTxIDReturnsOnCall == nil { 637 fake.getBlockByTxIDReturnsOnCall = make(map[int]struct { 638 result1 *common.Block 639 result2 error 640 }) 641 } 642 fake.getBlockByTxIDReturnsOnCall[i] = struct { 643 result1 *common.Block 644 result2 error 645 }{result1, result2} 646 } 647 648 func (fake *PeerLedger) GetBlockchainInfo() (*common.BlockchainInfo, error) { 649 fake.getBlockchainInfoMutex.Lock() 650 ret, specificReturn := fake.getBlockchainInfoReturnsOnCall[len(fake.getBlockchainInfoArgsForCall)] 651 fake.getBlockchainInfoArgsForCall = append(fake.getBlockchainInfoArgsForCall, struct { 652 }{}) 653 fake.recordInvocation("GetBlockchainInfo", []interface{}{}) 654 fake.getBlockchainInfoMutex.Unlock() 655 if fake.GetBlockchainInfoStub != nil { 656 return fake.GetBlockchainInfoStub() 657 } 658 if specificReturn { 659 return ret.result1, ret.result2 660 } 661 fakeReturns := fake.getBlockchainInfoReturns 662 return fakeReturns.result1, fakeReturns.result2 663 } 664 665 func (fake *PeerLedger) GetBlockchainInfoCallCount() int { 666 fake.getBlockchainInfoMutex.RLock() 667 defer fake.getBlockchainInfoMutex.RUnlock() 668 return len(fake.getBlockchainInfoArgsForCall) 669 } 670 671 func (fake *PeerLedger) GetBlockchainInfoCalls(stub func() (*common.BlockchainInfo, error)) { 672 fake.getBlockchainInfoMutex.Lock() 673 defer fake.getBlockchainInfoMutex.Unlock() 674 fake.GetBlockchainInfoStub = stub 675 } 676 677 func (fake *PeerLedger) GetBlockchainInfoReturns(result1 *common.BlockchainInfo, result2 error) { 678 fake.getBlockchainInfoMutex.Lock() 679 defer fake.getBlockchainInfoMutex.Unlock() 680 fake.GetBlockchainInfoStub = nil 681 fake.getBlockchainInfoReturns = struct { 682 result1 *common.BlockchainInfo 683 result2 error 684 }{result1, result2} 685 } 686 687 func (fake *PeerLedger) GetBlockchainInfoReturnsOnCall(i int, result1 *common.BlockchainInfo, result2 error) { 688 fake.getBlockchainInfoMutex.Lock() 689 defer fake.getBlockchainInfoMutex.Unlock() 690 fake.GetBlockchainInfoStub = nil 691 if fake.getBlockchainInfoReturnsOnCall == nil { 692 fake.getBlockchainInfoReturnsOnCall = make(map[int]struct { 693 result1 *common.BlockchainInfo 694 result2 error 695 }) 696 } 697 fake.getBlockchainInfoReturnsOnCall[i] = struct { 698 result1 *common.BlockchainInfo 699 result2 error 700 }{result1, result2} 701 } 702 703 func (fake *PeerLedger) GetBlocksIterator(arg1 uint64) (ledgera.ResultsIterator, error) { 704 fake.getBlocksIteratorMutex.Lock() 705 ret, specificReturn := fake.getBlocksIteratorReturnsOnCall[len(fake.getBlocksIteratorArgsForCall)] 706 fake.getBlocksIteratorArgsForCall = append(fake.getBlocksIteratorArgsForCall, struct { 707 arg1 uint64 708 }{arg1}) 709 fake.recordInvocation("GetBlocksIterator", []interface{}{arg1}) 710 fake.getBlocksIteratorMutex.Unlock() 711 if fake.GetBlocksIteratorStub != nil { 712 return fake.GetBlocksIteratorStub(arg1) 713 } 714 if specificReturn { 715 return ret.result1, ret.result2 716 } 717 fakeReturns := fake.getBlocksIteratorReturns 718 return fakeReturns.result1, fakeReturns.result2 719 } 720 721 func (fake *PeerLedger) GetBlocksIteratorCallCount() int { 722 fake.getBlocksIteratorMutex.RLock() 723 defer fake.getBlocksIteratorMutex.RUnlock() 724 return len(fake.getBlocksIteratorArgsForCall) 725 } 726 727 func (fake *PeerLedger) GetBlocksIteratorCalls(stub func(uint64) (ledgera.ResultsIterator, error)) { 728 fake.getBlocksIteratorMutex.Lock() 729 defer fake.getBlocksIteratorMutex.Unlock() 730 fake.GetBlocksIteratorStub = stub 731 } 732 733 func (fake *PeerLedger) GetBlocksIteratorArgsForCall(i int) uint64 { 734 fake.getBlocksIteratorMutex.RLock() 735 defer fake.getBlocksIteratorMutex.RUnlock() 736 argsForCall := fake.getBlocksIteratorArgsForCall[i] 737 return argsForCall.arg1 738 } 739 740 func (fake *PeerLedger) GetBlocksIteratorReturns(result1 ledgera.ResultsIterator, result2 error) { 741 fake.getBlocksIteratorMutex.Lock() 742 defer fake.getBlocksIteratorMutex.Unlock() 743 fake.GetBlocksIteratorStub = nil 744 fake.getBlocksIteratorReturns = struct { 745 result1 ledgera.ResultsIterator 746 result2 error 747 }{result1, result2} 748 } 749 750 func (fake *PeerLedger) GetBlocksIteratorReturnsOnCall(i int, result1 ledgera.ResultsIterator, result2 error) { 751 fake.getBlocksIteratorMutex.Lock() 752 defer fake.getBlocksIteratorMutex.Unlock() 753 fake.GetBlocksIteratorStub = nil 754 if fake.getBlocksIteratorReturnsOnCall == nil { 755 fake.getBlocksIteratorReturnsOnCall = make(map[int]struct { 756 result1 ledgera.ResultsIterator 757 result2 error 758 }) 759 } 760 fake.getBlocksIteratorReturnsOnCall[i] = struct { 761 result1 ledgera.ResultsIterator 762 result2 error 763 }{result1, result2} 764 } 765 766 func (fake *PeerLedger) GetConfigHistoryRetriever() (ledger.ConfigHistoryRetriever, error) { 767 fake.getConfigHistoryRetrieverMutex.Lock() 768 ret, specificReturn := fake.getConfigHistoryRetrieverReturnsOnCall[len(fake.getConfigHistoryRetrieverArgsForCall)] 769 fake.getConfigHistoryRetrieverArgsForCall = append(fake.getConfigHistoryRetrieverArgsForCall, struct { 770 }{}) 771 fake.recordInvocation("GetConfigHistoryRetriever", []interface{}{}) 772 fake.getConfigHistoryRetrieverMutex.Unlock() 773 if fake.GetConfigHistoryRetrieverStub != nil { 774 return fake.GetConfigHistoryRetrieverStub() 775 } 776 if specificReturn { 777 return ret.result1, ret.result2 778 } 779 fakeReturns := fake.getConfigHistoryRetrieverReturns 780 return fakeReturns.result1, fakeReturns.result2 781 } 782 783 func (fake *PeerLedger) GetConfigHistoryRetrieverCallCount() int { 784 fake.getConfigHistoryRetrieverMutex.RLock() 785 defer fake.getConfigHistoryRetrieverMutex.RUnlock() 786 return len(fake.getConfigHistoryRetrieverArgsForCall) 787 } 788 789 func (fake *PeerLedger) GetConfigHistoryRetrieverCalls(stub func() (ledger.ConfigHistoryRetriever, error)) { 790 fake.getConfigHistoryRetrieverMutex.Lock() 791 defer fake.getConfigHistoryRetrieverMutex.Unlock() 792 fake.GetConfigHistoryRetrieverStub = stub 793 } 794 795 func (fake *PeerLedger) GetConfigHistoryRetrieverReturns(result1 ledger.ConfigHistoryRetriever, result2 error) { 796 fake.getConfigHistoryRetrieverMutex.Lock() 797 defer fake.getConfigHistoryRetrieverMutex.Unlock() 798 fake.GetConfigHistoryRetrieverStub = nil 799 fake.getConfigHistoryRetrieverReturns = struct { 800 result1 ledger.ConfigHistoryRetriever 801 result2 error 802 }{result1, result2} 803 } 804 805 func (fake *PeerLedger) GetConfigHistoryRetrieverReturnsOnCall(i int, result1 ledger.ConfigHistoryRetriever, result2 error) { 806 fake.getConfigHistoryRetrieverMutex.Lock() 807 defer fake.getConfigHistoryRetrieverMutex.Unlock() 808 fake.GetConfigHistoryRetrieverStub = nil 809 if fake.getConfigHistoryRetrieverReturnsOnCall == nil { 810 fake.getConfigHistoryRetrieverReturnsOnCall = make(map[int]struct { 811 result1 ledger.ConfigHistoryRetriever 812 result2 error 813 }) 814 } 815 fake.getConfigHistoryRetrieverReturnsOnCall[i] = struct { 816 result1 ledger.ConfigHistoryRetriever 817 result2 error 818 }{result1, result2} 819 } 820 821 func (fake *PeerLedger) GetMissingPvtDataTracker() (ledger.MissingPvtDataTracker, error) { 822 fake.getMissingPvtDataTrackerMutex.Lock() 823 ret, specificReturn := fake.getMissingPvtDataTrackerReturnsOnCall[len(fake.getMissingPvtDataTrackerArgsForCall)] 824 fake.getMissingPvtDataTrackerArgsForCall = append(fake.getMissingPvtDataTrackerArgsForCall, struct { 825 }{}) 826 fake.recordInvocation("GetMissingPvtDataTracker", []interface{}{}) 827 fake.getMissingPvtDataTrackerMutex.Unlock() 828 if fake.GetMissingPvtDataTrackerStub != nil { 829 return fake.GetMissingPvtDataTrackerStub() 830 } 831 if specificReturn { 832 return ret.result1, ret.result2 833 } 834 fakeReturns := fake.getMissingPvtDataTrackerReturns 835 return fakeReturns.result1, fakeReturns.result2 836 } 837 838 func (fake *PeerLedger) GetMissingPvtDataTrackerCallCount() int { 839 fake.getMissingPvtDataTrackerMutex.RLock() 840 defer fake.getMissingPvtDataTrackerMutex.RUnlock() 841 return len(fake.getMissingPvtDataTrackerArgsForCall) 842 } 843 844 func (fake *PeerLedger) GetMissingPvtDataTrackerCalls(stub func() (ledger.MissingPvtDataTracker, error)) { 845 fake.getMissingPvtDataTrackerMutex.Lock() 846 defer fake.getMissingPvtDataTrackerMutex.Unlock() 847 fake.GetMissingPvtDataTrackerStub = stub 848 } 849 850 func (fake *PeerLedger) GetMissingPvtDataTrackerReturns(result1 ledger.MissingPvtDataTracker, result2 error) { 851 fake.getMissingPvtDataTrackerMutex.Lock() 852 defer fake.getMissingPvtDataTrackerMutex.Unlock() 853 fake.GetMissingPvtDataTrackerStub = nil 854 fake.getMissingPvtDataTrackerReturns = struct { 855 result1 ledger.MissingPvtDataTracker 856 result2 error 857 }{result1, result2} 858 } 859 860 func (fake *PeerLedger) GetMissingPvtDataTrackerReturnsOnCall(i int, result1 ledger.MissingPvtDataTracker, result2 error) { 861 fake.getMissingPvtDataTrackerMutex.Lock() 862 defer fake.getMissingPvtDataTrackerMutex.Unlock() 863 fake.GetMissingPvtDataTrackerStub = nil 864 if fake.getMissingPvtDataTrackerReturnsOnCall == nil { 865 fake.getMissingPvtDataTrackerReturnsOnCall = make(map[int]struct { 866 result1 ledger.MissingPvtDataTracker 867 result2 error 868 }) 869 } 870 fake.getMissingPvtDataTrackerReturnsOnCall[i] = struct { 871 result1 ledger.MissingPvtDataTracker 872 result2 error 873 }{result1, result2} 874 } 875 876 func (fake *PeerLedger) GetPvtDataAndBlockByNum(arg1 uint64, arg2 ledger.PvtNsCollFilter) (*ledger.BlockAndPvtData, error) { 877 fake.getPvtDataAndBlockByNumMutex.Lock() 878 ret, specificReturn := fake.getPvtDataAndBlockByNumReturnsOnCall[len(fake.getPvtDataAndBlockByNumArgsForCall)] 879 fake.getPvtDataAndBlockByNumArgsForCall = append(fake.getPvtDataAndBlockByNumArgsForCall, struct { 880 arg1 uint64 881 arg2 ledger.PvtNsCollFilter 882 }{arg1, arg2}) 883 fake.recordInvocation("GetPvtDataAndBlockByNum", []interface{}{arg1, arg2}) 884 fake.getPvtDataAndBlockByNumMutex.Unlock() 885 if fake.GetPvtDataAndBlockByNumStub != nil { 886 return fake.GetPvtDataAndBlockByNumStub(arg1, arg2) 887 } 888 if specificReturn { 889 return ret.result1, ret.result2 890 } 891 fakeReturns := fake.getPvtDataAndBlockByNumReturns 892 return fakeReturns.result1, fakeReturns.result2 893 } 894 895 func (fake *PeerLedger) GetPvtDataAndBlockByNumCallCount() int { 896 fake.getPvtDataAndBlockByNumMutex.RLock() 897 defer fake.getPvtDataAndBlockByNumMutex.RUnlock() 898 return len(fake.getPvtDataAndBlockByNumArgsForCall) 899 } 900 901 func (fake *PeerLedger) GetPvtDataAndBlockByNumCalls(stub func(uint64, ledger.PvtNsCollFilter) (*ledger.BlockAndPvtData, error)) { 902 fake.getPvtDataAndBlockByNumMutex.Lock() 903 defer fake.getPvtDataAndBlockByNumMutex.Unlock() 904 fake.GetPvtDataAndBlockByNumStub = stub 905 } 906 907 func (fake *PeerLedger) GetPvtDataAndBlockByNumArgsForCall(i int) (uint64, ledger.PvtNsCollFilter) { 908 fake.getPvtDataAndBlockByNumMutex.RLock() 909 defer fake.getPvtDataAndBlockByNumMutex.RUnlock() 910 argsForCall := fake.getPvtDataAndBlockByNumArgsForCall[i] 911 return argsForCall.arg1, argsForCall.arg2 912 } 913 914 func (fake *PeerLedger) GetPvtDataAndBlockByNumReturns(result1 *ledger.BlockAndPvtData, result2 error) { 915 fake.getPvtDataAndBlockByNumMutex.Lock() 916 defer fake.getPvtDataAndBlockByNumMutex.Unlock() 917 fake.GetPvtDataAndBlockByNumStub = nil 918 fake.getPvtDataAndBlockByNumReturns = struct { 919 result1 *ledger.BlockAndPvtData 920 result2 error 921 }{result1, result2} 922 } 923 924 func (fake *PeerLedger) GetPvtDataAndBlockByNumReturnsOnCall(i int, result1 *ledger.BlockAndPvtData, result2 error) { 925 fake.getPvtDataAndBlockByNumMutex.Lock() 926 defer fake.getPvtDataAndBlockByNumMutex.Unlock() 927 fake.GetPvtDataAndBlockByNumStub = nil 928 if fake.getPvtDataAndBlockByNumReturnsOnCall == nil { 929 fake.getPvtDataAndBlockByNumReturnsOnCall = make(map[int]struct { 930 result1 *ledger.BlockAndPvtData 931 result2 error 932 }) 933 } 934 fake.getPvtDataAndBlockByNumReturnsOnCall[i] = struct { 935 result1 *ledger.BlockAndPvtData 936 result2 error 937 }{result1, result2} 938 } 939 940 func (fake *PeerLedger) GetPvtDataByNum(arg1 uint64, arg2 ledger.PvtNsCollFilter) ([]*ledger.TxPvtData, error) { 941 fake.getPvtDataByNumMutex.Lock() 942 ret, specificReturn := fake.getPvtDataByNumReturnsOnCall[len(fake.getPvtDataByNumArgsForCall)] 943 fake.getPvtDataByNumArgsForCall = append(fake.getPvtDataByNumArgsForCall, struct { 944 arg1 uint64 945 arg2 ledger.PvtNsCollFilter 946 }{arg1, arg2}) 947 fake.recordInvocation("GetPvtDataByNum", []interface{}{arg1, arg2}) 948 fake.getPvtDataByNumMutex.Unlock() 949 if fake.GetPvtDataByNumStub != nil { 950 return fake.GetPvtDataByNumStub(arg1, arg2) 951 } 952 if specificReturn { 953 return ret.result1, ret.result2 954 } 955 fakeReturns := fake.getPvtDataByNumReturns 956 return fakeReturns.result1, fakeReturns.result2 957 } 958 959 func (fake *PeerLedger) GetPvtDataByNumCallCount() int { 960 fake.getPvtDataByNumMutex.RLock() 961 defer fake.getPvtDataByNumMutex.RUnlock() 962 return len(fake.getPvtDataByNumArgsForCall) 963 } 964 965 func (fake *PeerLedger) GetPvtDataByNumCalls(stub func(uint64, ledger.PvtNsCollFilter) ([]*ledger.TxPvtData, error)) { 966 fake.getPvtDataByNumMutex.Lock() 967 defer fake.getPvtDataByNumMutex.Unlock() 968 fake.GetPvtDataByNumStub = stub 969 } 970 971 func (fake *PeerLedger) GetPvtDataByNumArgsForCall(i int) (uint64, ledger.PvtNsCollFilter) { 972 fake.getPvtDataByNumMutex.RLock() 973 defer fake.getPvtDataByNumMutex.RUnlock() 974 argsForCall := fake.getPvtDataByNumArgsForCall[i] 975 return argsForCall.arg1, argsForCall.arg2 976 } 977 978 func (fake *PeerLedger) GetPvtDataByNumReturns(result1 []*ledger.TxPvtData, result2 error) { 979 fake.getPvtDataByNumMutex.Lock() 980 defer fake.getPvtDataByNumMutex.Unlock() 981 fake.GetPvtDataByNumStub = nil 982 fake.getPvtDataByNumReturns = struct { 983 result1 []*ledger.TxPvtData 984 result2 error 985 }{result1, result2} 986 } 987 988 func (fake *PeerLedger) GetPvtDataByNumReturnsOnCall(i int, result1 []*ledger.TxPvtData, result2 error) { 989 fake.getPvtDataByNumMutex.Lock() 990 defer fake.getPvtDataByNumMutex.Unlock() 991 fake.GetPvtDataByNumStub = nil 992 if fake.getPvtDataByNumReturnsOnCall == nil { 993 fake.getPvtDataByNumReturnsOnCall = make(map[int]struct { 994 result1 []*ledger.TxPvtData 995 result2 error 996 }) 997 } 998 fake.getPvtDataByNumReturnsOnCall[i] = struct { 999 result1 []*ledger.TxPvtData 1000 result2 error 1001 }{result1, result2} 1002 } 1003 1004 func (fake *PeerLedger) GetTransactionByID(arg1 string) (*peer.ProcessedTransaction, error) { 1005 fake.getTransactionByIDMutex.Lock() 1006 ret, specificReturn := fake.getTransactionByIDReturnsOnCall[len(fake.getTransactionByIDArgsForCall)] 1007 fake.getTransactionByIDArgsForCall = append(fake.getTransactionByIDArgsForCall, struct { 1008 arg1 string 1009 }{arg1}) 1010 fake.recordInvocation("GetTransactionByID", []interface{}{arg1}) 1011 fake.getTransactionByIDMutex.Unlock() 1012 if fake.GetTransactionByIDStub != nil { 1013 return fake.GetTransactionByIDStub(arg1) 1014 } 1015 if specificReturn { 1016 return ret.result1, ret.result2 1017 } 1018 fakeReturns := fake.getTransactionByIDReturns 1019 return fakeReturns.result1, fakeReturns.result2 1020 } 1021 1022 func (fake *PeerLedger) GetTransactionByIDCallCount() int { 1023 fake.getTransactionByIDMutex.RLock() 1024 defer fake.getTransactionByIDMutex.RUnlock() 1025 return len(fake.getTransactionByIDArgsForCall) 1026 } 1027 1028 func (fake *PeerLedger) GetTransactionByIDCalls(stub func(string) (*peer.ProcessedTransaction, error)) { 1029 fake.getTransactionByIDMutex.Lock() 1030 defer fake.getTransactionByIDMutex.Unlock() 1031 fake.GetTransactionByIDStub = stub 1032 } 1033 1034 func (fake *PeerLedger) GetTransactionByIDArgsForCall(i int) string { 1035 fake.getTransactionByIDMutex.RLock() 1036 defer fake.getTransactionByIDMutex.RUnlock() 1037 argsForCall := fake.getTransactionByIDArgsForCall[i] 1038 return argsForCall.arg1 1039 } 1040 1041 func (fake *PeerLedger) GetTransactionByIDReturns(result1 *peer.ProcessedTransaction, result2 error) { 1042 fake.getTransactionByIDMutex.Lock() 1043 defer fake.getTransactionByIDMutex.Unlock() 1044 fake.GetTransactionByIDStub = nil 1045 fake.getTransactionByIDReturns = struct { 1046 result1 *peer.ProcessedTransaction 1047 result2 error 1048 }{result1, result2} 1049 } 1050 1051 func (fake *PeerLedger) GetTransactionByIDReturnsOnCall(i int, result1 *peer.ProcessedTransaction, result2 error) { 1052 fake.getTransactionByIDMutex.Lock() 1053 defer fake.getTransactionByIDMutex.Unlock() 1054 fake.GetTransactionByIDStub = nil 1055 if fake.getTransactionByIDReturnsOnCall == nil { 1056 fake.getTransactionByIDReturnsOnCall = make(map[int]struct { 1057 result1 *peer.ProcessedTransaction 1058 result2 error 1059 }) 1060 } 1061 fake.getTransactionByIDReturnsOnCall[i] = struct { 1062 result1 *peer.ProcessedTransaction 1063 result2 error 1064 }{result1, result2} 1065 } 1066 1067 func (fake *PeerLedger) GetTxValidationCodeByTxID(arg1 string) (peer.TxValidationCode, error) { 1068 fake.getTxValidationCodeByTxIDMutex.Lock() 1069 ret, specificReturn := fake.getTxValidationCodeByTxIDReturnsOnCall[len(fake.getTxValidationCodeByTxIDArgsForCall)] 1070 fake.getTxValidationCodeByTxIDArgsForCall = append(fake.getTxValidationCodeByTxIDArgsForCall, struct { 1071 arg1 string 1072 }{arg1}) 1073 fake.recordInvocation("GetTxValidationCodeByTxID", []interface{}{arg1}) 1074 fake.getTxValidationCodeByTxIDMutex.Unlock() 1075 if fake.GetTxValidationCodeByTxIDStub != nil { 1076 return fake.GetTxValidationCodeByTxIDStub(arg1) 1077 } 1078 if specificReturn { 1079 return ret.result1, ret.result2 1080 } 1081 fakeReturns := fake.getTxValidationCodeByTxIDReturns 1082 return fakeReturns.result1, fakeReturns.result2 1083 } 1084 1085 func (fake *PeerLedger) GetTxValidationCodeByTxIDCallCount() int { 1086 fake.getTxValidationCodeByTxIDMutex.RLock() 1087 defer fake.getTxValidationCodeByTxIDMutex.RUnlock() 1088 return len(fake.getTxValidationCodeByTxIDArgsForCall) 1089 } 1090 1091 func (fake *PeerLedger) GetTxValidationCodeByTxIDCalls(stub func(string) (peer.TxValidationCode, error)) { 1092 fake.getTxValidationCodeByTxIDMutex.Lock() 1093 defer fake.getTxValidationCodeByTxIDMutex.Unlock() 1094 fake.GetTxValidationCodeByTxIDStub = stub 1095 } 1096 1097 func (fake *PeerLedger) GetTxValidationCodeByTxIDArgsForCall(i int) string { 1098 fake.getTxValidationCodeByTxIDMutex.RLock() 1099 defer fake.getTxValidationCodeByTxIDMutex.RUnlock() 1100 argsForCall := fake.getTxValidationCodeByTxIDArgsForCall[i] 1101 return argsForCall.arg1 1102 } 1103 1104 func (fake *PeerLedger) GetTxValidationCodeByTxIDReturns(result1 peer.TxValidationCode, result2 error) { 1105 fake.getTxValidationCodeByTxIDMutex.Lock() 1106 defer fake.getTxValidationCodeByTxIDMutex.Unlock() 1107 fake.GetTxValidationCodeByTxIDStub = nil 1108 fake.getTxValidationCodeByTxIDReturns = struct { 1109 result1 peer.TxValidationCode 1110 result2 error 1111 }{result1, result2} 1112 } 1113 1114 func (fake *PeerLedger) GetTxValidationCodeByTxIDReturnsOnCall(i int, result1 peer.TxValidationCode, result2 error) { 1115 fake.getTxValidationCodeByTxIDMutex.Lock() 1116 defer fake.getTxValidationCodeByTxIDMutex.Unlock() 1117 fake.GetTxValidationCodeByTxIDStub = nil 1118 if fake.getTxValidationCodeByTxIDReturnsOnCall == nil { 1119 fake.getTxValidationCodeByTxIDReturnsOnCall = make(map[int]struct { 1120 result1 peer.TxValidationCode 1121 result2 error 1122 }) 1123 } 1124 fake.getTxValidationCodeByTxIDReturnsOnCall[i] = struct { 1125 result1 peer.TxValidationCode 1126 result2 error 1127 }{result1, result2} 1128 } 1129 1130 func (fake *PeerLedger) NewHistoryQueryExecutor() (ledger.HistoryQueryExecutor, error) { 1131 fake.newHistoryQueryExecutorMutex.Lock() 1132 ret, specificReturn := fake.newHistoryQueryExecutorReturnsOnCall[len(fake.newHistoryQueryExecutorArgsForCall)] 1133 fake.newHistoryQueryExecutorArgsForCall = append(fake.newHistoryQueryExecutorArgsForCall, struct { 1134 }{}) 1135 fake.recordInvocation("NewHistoryQueryExecutor", []interface{}{}) 1136 fake.newHistoryQueryExecutorMutex.Unlock() 1137 if fake.NewHistoryQueryExecutorStub != nil { 1138 return fake.NewHistoryQueryExecutorStub() 1139 } 1140 if specificReturn { 1141 return ret.result1, ret.result2 1142 } 1143 fakeReturns := fake.newHistoryQueryExecutorReturns 1144 return fakeReturns.result1, fakeReturns.result2 1145 } 1146 1147 func (fake *PeerLedger) NewHistoryQueryExecutorCallCount() int { 1148 fake.newHistoryQueryExecutorMutex.RLock() 1149 defer fake.newHistoryQueryExecutorMutex.RUnlock() 1150 return len(fake.newHistoryQueryExecutorArgsForCall) 1151 } 1152 1153 func (fake *PeerLedger) NewHistoryQueryExecutorCalls(stub func() (ledger.HistoryQueryExecutor, error)) { 1154 fake.newHistoryQueryExecutorMutex.Lock() 1155 defer fake.newHistoryQueryExecutorMutex.Unlock() 1156 fake.NewHistoryQueryExecutorStub = stub 1157 } 1158 1159 func (fake *PeerLedger) NewHistoryQueryExecutorReturns(result1 ledger.HistoryQueryExecutor, result2 error) { 1160 fake.newHistoryQueryExecutorMutex.Lock() 1161 defer fake.newHistoryQueryExecutorMutex.Unlock() 1162 fake.NewHistoryQueryExecutorStub = nil 1163 fake.newHistoryQueryExecutorReturns = struct { 1164 result1 ledger.HistoryQueryExecutor 1165 result2 error 1166 }{result1, result2} 1167 } 1168 1169 func (fake *PeerLedger) NewHistoryQueryExecutorReturnsOnCall(i int, result1 ledger.HistoryQueryExecutor, result2 error) { 1170 fake.newHistoryQueryExecutorMutex.Lock() 1171 defer fake.newHistoryQueryExecutorMutex.Unlock() 1172 fake.NewHistoryQueryExecutorStub = nil 1173 if fake.newHistoryQueryExecutorReturnsOnCall == nil { 1174 fake.newHistoryQueryExecutorReturnsOnCall = make(map[int]struct { 1175 result1 ledger.HistoryQueryExecutor 1176 result2 error 1177 }) 1178 } 1179 fake.newHistoryQueryExecutorReturnsOnCall[i] = struct { 1180 result1 ledger.HistoryQueryExecutor 1181 result2 error 1182 }{result1, result2} 1183 } 1184 1185 func (fake *PeerLedger) NewQueryExecutor() (ledger.QueryExecutor, error) { 1186 fake.newQueryExecutorMutex.Lock() 1187 ret, specificReturn := fake.newQueryExecutorReturnsOnCall[len(fake.newQueryExecutorArgsForCall)] 1188 fake.newQueryExecutorArgsForCall = append(fake.newQueryExecutorArgsForCall, struct { 1189 }{}) 1190 fake.recordInvocation("NewQueryExecutor", []interface{}{}) 1191 fake.newQueryExecutorMutex.Unlock() 1192 if fake.NewQueryExecutorStub != nil { 1193 return fake.NewQueryExecutorStub() 1194 } 1195 if specificReturn { 1196 return ret.result1, ret.result2 1197 } 1198 fakeReturns := fake.newQueryExecutorReturns 1199 return fakeReturns.result1, fakeReturns.result2 1200 } 1201 1202 func (fake *PeerLedger) NewQueryExecutorCallCount() int { 1203 fake.newQueryExecutorMutex.RLock() 1204 defer fake.newQueryExecutorMutex.RUnlock() 1205 return len(fake.newQueryExecutorArgsForCall) 1206 } 1207 1208 func (fake *PeerLedger) NewQueryExecutorCalls(stub func() (ledger.QueryExecutor, error)) { 1209 fake.newQueryExecutorMutex.Lock() 1210 defer fake.newQueryExecutorMutex.Unlock() 1211 fake.NewQueryExecutorStub = stub 1212 } 1213 1214 func (fake *PeerLedger) NewQueryExecutorReturns(result1 ledger.QueryExecutor, result2 error) { 1215 fake.newQueryExecutorMutex.Lock() 1216 defer fake.newQueryExecutorMutex.Unlock() 1217 fake.NewQueryExecutorStub = nil 1218 fake.newQueryExecutorReturns = struct { 1219 result1 ledger.QueryExecutor 1220 result2 error 1221 }{result1, result2} 1222 } 1223 1224 func (fake *PeerLedger) NewQueryExecutorReturnsOnCall(i int, result1 ledger.QueryExecutor, result2 error) { 1225 fake.newQueryExecutorMutex.Lock() 1226 defer fake.newQueryExecutorMutex.Unlock() 1227 fake.NewQueryExecutorStub = nil 1228 if fake.newQueryExecutorReturnsOnCall == nil { 1229 fake.newQueryExecutorReturnsOnCall = make(map[int]struct { 1230 result1 ledger.QueryExecutor 1231 result2 error 1232 }) 1233 } 1234 fake.newQueryExecutorReturnsOnCall[i] = struct { 1235 result1 ledger.QueryExecutor 1236 result2 error 1237 }{result1, result2} 1238 } 1239 1240 func (fake *PeerLedger) NewTxSimulator(arg1 string) (ledger.TxSimulator, error) { 1241 fake.newTxSimulatorMutex.Lock() 1242 ret, specificReturn := fake.newTxSimulatorReturnsOnCall[len(fake.newTxSimulatorArgsForCall)] 1243 fake.newTxSimulatorArgsForCall = append(fake.newTxSimulatorArgsForCall, struct { 1244 arg1 string 1245 }{arg1}) 1246 fake.recordInvocation("NewTxSimulator", []interface{}{arg1}) 1247 fake.newTxSimulatorMutex.Unlock() 1248 if fake.NewTxSimulatorStub != nil { 1249 return fake.NewTxSimulatorStub(arg1) 1250 } 1251 if specificReturn { 1252 return ret.result1, ret.result2 1253 } 1254 fakeReturns := fake.newTxSimulatorReturns 1255 return fakeReturns.result1, fakeReturns.result2 1256 } 1257 1258 func (fake *PeerLedger) NewTxSimulatorCallCount() int { 1259 fake.newTxSimulatorMutex.RLock() 1260 defer fake.newTxSimulatorMutex.RUnlock() 1261 return len(fake.newTxSimulatorArgsForCall) 1262 } 1263 1264 func (fake *PeerLedger) NewTxSimulatorCalls(stub func(string) (ledger.TxSimulator, error)) { 1265 fake.newTxSimulatorMutex.Lock() 1266 defer fake.newTxSimulatorMutex.Unlock() 1267 fake.NewTxSimulatorStub = stub 1268 } 1269 1270 func (fake *PeerLedger) NewTxSimulatorArgsForCall(i int) string { 1271 fake.newTxSimulatorMutex.RLock() 1272 defer fake.newTxSimulatorMutex.RUnlock() 1273 argsForCall := fake.newTxSimulatorArgsForCall[i] 1274 return argsForCall.arg1 1275 } 1276 1277 func (fake *PeerLedger) NewTxSimulatorReturns(result1 ledger.TxSimulator, result2 error) { 1278 fake.newTxSimulatorMutex.Lock() 1279 defer fake.newTxSimulatorMutex.Unlock() 1280 fake.NewTxSimulatorStub = nil 1281 fake.newTxSimulatorReturns = struct { 1282 result1 ledger.TxSimulator 1283 result2 error 1284 }{result1, result2} 1285 } 1286 1287 func (fake *PeerLedger) NewTxSimulatorReturnsOnCall(i int, result1 ledger.TxSimulator, result2 error) { 1288 fake.newTxSimulatorMutex.Lock() 1289 defer fake.newTxSimulatorMutex.Unlock() 1290 fake.NewTxSimulatorStub = nil 1291 if fake.newTxSimulatorReturnsOnCall == nil { 1292 fake.newTxSimulatorReturnsOnCall = make(map[int]struct { 1293 result1 ledger.TxSimulator 1294 result2 error 1295 }) 1296 } 1297 fake.newTxSimulatorReturnsOnCall[i] = struct { 1298 result1 ledger.TxSimulator 1299 result2 error 1300 }{result1, result2} 1301 } 1302 1303 func (fake *PeerLedger) Invocations() map[string][][]interface{} { 1304 fake.invocationsMutex.RLock() 1305 defer fake.invocationsMutex.RUnlock() 1306 fake.closeMutex.RLock() 1307 defer fake.closeMutex.RUnlock() 1308 fake.commitLegacyMutex.RLock() 1309 defer fake.commitLegacyMutex.RUnlock() 1310 fake.commitPvtDataOfOldBlocksMutex.RLock() 1311 defer fake.commitPvtDataOfOldBlocksMutex.RUnlock() 1312 fake.doesPvtDataInfoExistMutex.RLock() 1313 defer fake.doesPvtDataInfoExistMutex.RUnlock() 1314 fake.getBlockByHashMutex.RLock() 1315 defer fake.getBlockByHashMutex.RUnlock() 1316 fake.getBlockByNumberMutex.RLock() 1317 defer fake.getBlockByNumberMutex.RUnlock() 1318 fake.getBlockByTxIDMutex.RLock() 1319 defer fake.getBlockByTxIDMutex.RUnlock() 1320 fake.getBlockchainInfoMutex.RLock() 1321 defer fake.getBlockchainInfoMutex.RUnlock() 1322 fake.getBlocksIteratorMutex.RLock() 1323 defer fake.getBlocksIteratorMutex.RUnlock() 1324 fake.getConfigHistoryRetrieverMutex.RLock() 1325 defer fake.getConfigHistoryRetrieverMutex.RUnlock() 1326 fake.getMissingPvtDataTrackerMutex.RLock() 1327 defer fake.getMissingPvtDataTrackerMutex.RUnlock() 1328 fake.getPvtDataAndBlockByNumMutex.RLock() 1329 defer fake.getPvtDataAndBlockByNumMutex.RUnlock() 1330 fake.getPvtDataByNumMutex.RLock() 1331 defer fake.getPvtDataByNumMutex.RUnlock() 1332 fake.getTransactionByIDMutex.RLock() 1333 defer fake.getTransactionByIDMutex.RUnlock() 1334 fake.getTxValidationCodeByTxIDMutex.RLock() 1335 defer fake.getTxValidationCodeByTxIDMutex.RUnlock() 1336 fake.newHistoryQueryExecutorMutex.RLock() 1337 defer fake.newHistoryQueryExecutorMutex.RUnlock() 1338 fake.newQueryExecutorMutex.RLock() 1339 defer fake.newQueryExecutorMutex.RUnlock() 1340 fake.newTxSimulatorMutex.RLock() 1341 defer fake.newTxSimulatorMutex.RUnlock() 1342 copiedInvocations := map[string][][]interface{}{} 1343 for key, value := range fake.invocations { 1344 copiedInvocations[key] = value 1345 } 1346 return copiedInvocations 1347 } 1348 1349 func (fake *PeerLedger) recordInvocation(key string, args []interface{}) { 1350 fake.invocationsMutex.Lock() 1351 defer fake.invocationsMutex.Unlock() 1352 if fake.invocations == nil { 1353 fake.invocations = map[string][][]interface{}{} 1354 } 1355 if fake.invocations[key] == nil { 1356 fake.invocations[key] = [][]interface{}{} 1357 } 1358 fake.invocations[key] = append(fake.invocations[key], args) 1359 }