github.com/hyperledger-labs/bdls@v2.1.1+incompatible/core/chaincode/lifecycle/mock/scc_functions.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mock 3 4 import ( 5 "sync" 6 7 "github.com/hyperledger/fabric/common/chaincode" 8 "github.com/hyperledger/fabric/core/chaincode/lifecycle" 9 ) 10 11 type SCCFunctions struct { 12 ApproveChaincodeDefinitionForOrgStub func(string, string, *lifecycle.ChaincodeDefinition, string, lifecycle.ReadableState, lifecycle.ReadWritableState) error 13 approveChaincodeDefinitionForOrgMutex sync.RWMutex 14 approveChaincodeDefinitionForOrgArgsForCall []struct { 15 arg1 string 16 arg2 string 17 arg3 *lifecycle.ChaincodeDefinition 18 arg4 string 19 arg5 lifecycle.ReadableState 20 arg6 lifecycle.ReadWritableState 21 } 22 approveChaincodeDefinitionForOrgReturns struct { 23 result1 error 24 } 25 approveChaincodeDefinitionForOrgReturnsOnCall map[int]struct { 26 result1 error 27 } 28 CheckCommitReadinessStub func(string, string, *lifecycle.ChaincodeDefinition, lifecycle.ReadWritableState, []lifecycle.OpaqueState) (map[string]bool, error) 29 checkCommitReadinessMutex sync.RWMutex 30 checkCommitReadinessArgsForCall []struct { 31 arg1 string 32 arg2 string 33 arg3 *lifecycle.ChaincodeDefinition 34 arg4 lifecycle.ReadWritableState 35 arg5 []lifecycle.OpaqueState 36 } 37 checkCommitReadinessReturns struct { 38 result1 map[string]bool 39 result2 error 40 } 41 checkCommitReadinessReturnsOnCall map[int]struct { 42 result1 map[string]bool 43 result2 error 44 } 45 CommitChaincodeDefinitionStub func(string, string, *lifecycle.ChaincodeDefinition, lifecycle.ReadWritableState, []lifecycle.OpaqueState) (map[string]bool, error) 46 commitChaincodeDefinitionMutex sync.RWMutex 47 commitChaincodeDefinitionArgsForCall []struct { 48 arg1 string 49 arg2 string 50 arg3 *lifecycle.ChaincodeDefinition 51 arg4 lifecycle.ReadWritableState 52 arg5 []lifecycle.OpaqueState 53 } 54 commitChaincodeDefinitionReturns struct { 55 result1 map[string]bool 56 result2 error 57 } 58 commitChaincodeDefinitionReturnsOnCall map[int]struct { 59 result1 map[string]bool 60 result2 error 61 } 62 GetInstalledChaincodePackageStub func(string) ([]byte, error) 63 getInstalledChaincodePackageMutex sync.RWMutex 64 getInstalledChaincodePackageArgsForCall []struct { 65 arg1 string 66 } 67 getInstalledChaincodePackageReturns struct { 68 result1 []byte 69 result2 error 70 } 71 getInstalledChaincodePackageReturnsOnCall map[int]struct { 72 result1 []byte 73 result2 error 74 } 75 InstallChaincodeStub func([]byte) (*chaincode.InstalledChaincode, error) 76 installChaincodeMutex sync.RWMutex 77 installChaincodeArgsForCall []struct { 78 arg1 []byte 79 } 80 installChaincodeReturns struct { 81 result1 *chaincode.InstalledChaincode 82 result2 error 83 } 84 installChaincodeReturnsOnCall map[int]struct { 85 result1 *chaincode.InstalledChaincode 86 result2 error 87 } 88 QueryChaincodeDefinitionStub func(string, lifecycle.ReadableState) (*lifecycle.ChaincodeDefinition, error) 89 queryChaincodeDefinitionMutex sync.RWMutex 90 queryChaincodeDefinitionArgsForCall []struct { 91 arg1 string 92 arg2 lifecycle.ReadableState 93 } 94 queryChaincodeDefinitionReturns struct { 95 result1 *lifecycle.ChaincodeDefinition 96 result2 error 97 } 98 queryChaincodeDefinitionReturnsOnCall map[int]struct { 99 result1 *lifecycle.ChaincodeDefinition 100 result2 error 101 } 102 QueryInstalledChaincodeStub func(string) (*chaincode.InstalledChaincode, error) 103 queryInstalledChaincodeMutex sync.RWMutex 104 queryInstalledChaincodeArgsForCall []struct { 105 arg1 string 106 } 107 queryInstalledChaincodeReturns struct { 108 result1 *chaincode.InstalledChaincode 109 result2 error 110 } 111 queryInstalledChaincodeReturnsOnCall map[int]struct { 112 result1 *chaincode.InstalledChaincode 113 result2 error 114 } 115 QueryInstalledChaincodesStub func() []*chaincode.InstalledChaincode 116 queryInstalledChaincodesMutex sync.RWMutex 117 queryInstalledChaincodesArgsForCall []struct { 118 } 119 queryInstalledChaincodesReturns struct { 120 result1 []*chaincode.InstalledChaincode 121 } 122 queryInstalledChaincodesReturnsOnCall map[int]struct { 123 result1 []*chaincode.InstalledChaincode 124 } 125 QueryNamespaceDefinitionsStub func(lifecycle.RangeableState) (map[string]string, error) 126 queryNamespaceDefinitionsMutex sync.RWMutex 127 queryNamespaceDefinitionsArgsForCall []struct { 128 arg1 lifecycle.RangeableState 129 } 130 queryNamespaceDefinitionsReturns struct { 131 result1 map[string]string 132 result2 error 133 } 134 queryNamespaceDefinitionsReturnsOnCall map[int]struct { 135 result1 map[string]string 136 result2 error 137 } 138 QueryOrgApprovalsStub func(string, *lifecycle.ChaincodeDefinition, []lifecycle.OpaqueState) (map[string]bool, error) 139 queryOrgApprovalsMutex sync.RWMutex 140 queryOrgApprovalsArgsForCall []struct { 141 arg1 string 142 arg2 *lifecycle.ChaincodeDefinition 143 arg3 []lifecycle.OpaqueState 144 } 145 queryOrgApprovalsReturns struct { 146 result1 map[string]bool 147 result2 error 148 } 149 queryOrgApprovalsReturnsOnCall map[int]struct { 150 result1 map[string]bool 151 result2 error 152 } 153 invocations map[string][][]interface{} 154 invocationsMutex sync.RWMutex 155 } 156 157 func (fake *SCCFunctions) ApproveChaincodeDefinitionForOrg(arg1 string, arg2 string, arg3 *lifecycle.ChaincodeDefinition, arg4 string, arg5 lifecycle.ReadableState, arg6 lifecycle.ReadWritableState) error { 158 fake.approveChaincodeDefinitionForOrgMutex.Lock() 159 ret, specificReturn := fake.approveChaincodeDefinitionForOrgReturnsOnCall[len(fake.approveChaincodeDefinitionForOrgArgsForCall)] 160 fake.approveChaincodeDefinitionForOrgArgsForCall = append(fake.approveChaincodeDefinitionForOrgArgsForCall, struct { 161 arg1 string 162 arg2 string 163 arg3 *lifecycle.ChaincodeDefinition 164 arg4 string 165 arg5 lifecycle.ReadableState 166 arg6 lifecycle.ReadWritableState 167 }{arg1, arg2, arg3, arg4, arg5, arg6}) 168 fake.recordInvocation("ApproveChaincodeDefinitionForOrg", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6}) 169 fake.approveChaincodeDefinitionForOrgMutex.Unlock() 170 if fake.ApproveChaincodeDefinitionForOrgStub != nil { 171 return fake.ApproveChaincodeDefinitionForOrgStub(arg1, arg2, arg3, arg4, arg5, arg6) 172 } 173 if specificReturn { 174 return ret.result1 175 } 176 fakeReturns := fake.approveChaincodeDefinitionForOrgReturns 177 return fakeReturns.result1 178 } 179 180 func (fake *SCCFunctions) ApproveChaincodeDefinitionForOrgCallCount() int { 181 fake.approveChaincodeDefinitionForOrgMutex.RLock() 182 defer fake.approveChaincodeDefinitionForOrgMutex.RUnlock() 183 return len(fake.approveChaincodeDefinitionForOrgArgsForCall) 184 } 185 186 func (fake *SCCFunctions) ApproveChaincodeDefinitionForOrgCalls(stub func(string, string, *lifecycle.ChaincodeDefinition, string, lifecycle.ReadableState, lifecycle.ReadWritableState) error) { 187 fake.approveChaincodeDefinitionForOrgMutex.Lock() 188 defer fake.approveChaincodeDefinitionForOrgMutex.Unlock() 189 fake.ApproveChaincodeDefinitionForOrgStub = stub 190 } 191 192 func (fake *SCCFunctions) ApproveChaincodeDefinitionForOrgArgsForCall(i int) (string, string, *lifecycle.ChaincodeDefinition, string, lifecycle.ReadableState, lifecycle.ReadWritableState) { 193 fake.approveChaincodeDefinitionForOrgMutex.RLock() 194 defer fake.approveChaincodeDefinitionForOrgMutex.RUnlock() 195 argsForCall := fake.approveChaincodeDefinitionForOrgArgsForCall[i] 196 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6 197 } 198 199 func (fake *SCCFunctions) ApproveChaincodeDefinitionForOrgReturns(result1 error) { 200 fake.approveChaincodeDefinitionForOrgMutex.Lock() 201 defer fake.approveChaincodeDefinitionForOrgMutex.Unlock() 202 fake.ApproveChaincodeDefinitionForOrgStub = nil 203 fake.approveChaincodeDefinitionForOrgReturns = struct { 204 result1 error 205 }{result1} 206 } 207 208 func (fake *SCCFunctions) ApproveChaincodeDefinitionForOrgReturnsOnCall(i int, result1 error) { 209 fake.approveChaincodeDefinitionForOrgMutex.Lock() 210 defer fake.approveChaincodeDefinitionForOrgMutex.Unlock() 211 fake.ApproveChaincodeDefinitionForOrgStub = nil 212 if fake.approveChaincodeDefinitionForOrgReturnsOnCall == nil { 213 fake.approveChaincodeDefinitionForOrgReturnsOnCall = make(map[int]struct { 214 result1 error 215 }) 216 } 217 fake.approveChaincodeDefinitionForOrgReturnsOnCall[i] = struct { 218 result1 error 219 }{result1} 220 } 221 222 func (fake *SCCFunctions) CheckCommitReadiness(arg1 string, arg2 string, arg3 *lifecycle.ChaincodeDefinition, arg4 lifecycle.ReadWritableState, arg5 []lifecycle.OpaqueState) (map[string]bool, error) { 223 var arg5Copy []lifecycle.OpaqueState 224 if arg5 != nil { 225 arg5Copy = make([]lifecycle.OpaqueState, len(arg5)) 226 copy(arg5Copy, arg5) 227 } 228 fake.checkCommitReadinessMutex.Lock() 229 ret, specificReturn := fake.checkCommitReadinessReturnsOnCall[len(fake.checkCommitReadinessArgsForCall)] 230 fake.checkCommitReadinessArgsForCall = append(fake.checkCommitReadinessArgsForCall, struct { 231 arg1 string 232 arg2 string 233 arg3 *lifecycle.ChaincodeDefinition 234 arg4 lifecycle.ReadWritableState 235 arg5 []lifecycle.OpaqueState 236 }{arg1, arg2, arg3, arg4, arg5Copy}) 237 fake.recordInvocation("CheckCommitReadiness", []interface{}{arg1, arg2, arg3, arg4, arg5Copy}) 238 fake.checkCommitReadinessMutex.Unlock() 239 if fake.CheckCommitReadinessStub != nil { 240 return fake.CheckCommitReadinessStub(arg1, arg2, arg3, arg4, arg5) 241 } 242 if specificReturn { 243 return ret.result1, ret.result2 244 } 245 fakeReturns := fake.checkCommitReadinessReturns 246 return fakeReturns.result1, fakeReturns.result2 247 } 248 249 func (fake *SCCFunctions) CheckCommitReadinessCallCount() int { 250 fake.checkCommitReadinessMutex.RLock() 251 defer fake.checkCommitReadinessMutex.RUnlock() 252 return len(fake.checkCommitReadinessArgsForCall) 253 } 254 255 func (fake *SCCFunctions) CheckCommitReadinessCalls(stub func(string, string, *lifecycle.ChaincodeDefinition, lifecycle.ReadWritableState, []lifecycle.OpaqueState) (map[string]bool, error)) { 256 fake.checkCommitReadinessMutex.Lock() 257 defer fake.checkCommitReadinessMutex.Unlock() 258 fake.CheckCommitReadinessStub = stub 259 } 260 261 func (fake *SCCFunctions) CheckCommitReadinessArgsForCall(i int) (string, string, *lifecycle.ChaincodeDefinition, lifecycle.ReadWritableState, []lifecycle.OpaqueState) { 262 fake.checkCommitReadinessMutex.RLock() 263 defer fake.checkCommitReadinessMutex.RUnlock() 264 argsForCall := fake.checkCommitReadinessArgsForCall[i] 265 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5 266 } 267 268 func (fake *SCCFunctions) CheckCommitReadinessReturns(result1 map[string]bool, result2 error) { 269 fake.checkCommitReadinessMutex.Lock() 270 defer fake.checkCommitReadinessMutex.Unlock() 271 fake.CheckCommitReadinessStub = nil 272 fake.checkCommitReadinessReturns = struct { 273 result1 map[string]bool 274 result2 error 275 }{result1, result2} 276 } 277 278 func (fake *SCCFunctions) CheckCommitReadinessReturnsOnCall(i int, result1 map[string]bool, result2 error) { 279 fake.checkCommitReadinessMutex.Lock() 280 defer fake.checkCommitReadinessMutex.Unlock() 281 fake.CheckCommitReadinessStub = nil 282 if fake.checkCommitReadinessReturnsOnCall == nil { 283 fake.checkCommitReadinessReturnsOnCall = make(map[int]struct { 284 result1 map[string]bool 285 result2 error 286 }) 287 } 288 fake.checkCommitReadinessReturnsOnCall[i] = struct { 289 result1 map[string]bool 290 result2 error 291 }{result1, result2} 292 } 293 294 func (fake *SCCFunctions) CommitChaincodeDefinition(arg1 string, arg2 string, arg3 *lifecycle.ChaincodeDefinition, arg4 lifecycle.ReadWritableState, arg5 []lifecycle.OpaqueState) (map[string]bool, error) { 295 var arg5Copy []lifecycle.OpaqueState 296 if arg5 != nil { 297 arg5Copy = make([]lifecycle.OpaqueState, len(arg5)) 298 copy(arg5Copy, arg5) 299 } 300 fake.commitChaincodeDefinitionMutex.Lock() 301 ret, specificReturn := fake.commitChaincodeDefinitionReturnsOnCall[len(fake.commitChaincodeDefinitionArgsForCall)] 302 fake.commitChaincodeDefinitionArgsForCall = append(fake.commitChaincodeDefinitionArgsForCall, struct { 303 arg1 string 304 arg2 string 305 arg3 *lifecycle.ChaincodeDefinition 306 arg4 lifecycle.ReadWritableState 307 arg5 []lifecycle.OpaqueState 308 }{arg1, arg2, arg3, arg4, arg5Copy}) 309 fake.recordInvocation("CommitChaincodeDefinition", []interface{}{arg1, arg2, arg3, arg4, arg5Copy}) 310 fake.commitChaincodeDefinitionMutex.Unlock() 311 if fake.CommitChaincodeDefinitionStub != nil { 312 return fake.CommitChaincodeDefinitionStub(arg1, arg2, arg3, arg4, arg5) 313 } 314 if specificReturn { 315 return ret.result1, ret.result2 316 } 317 fakeReturns := fake.commitChaincodeDefinitionReturns 318 return fakeReturns.result1, fakeReturns.result2 319 } 320 321 func (fake *SCCFunctions) CommitChaincodeDefinitionCallCount() int { 322 fake.commitChaincodeDefinitionMutex.RLock() 323 defer fake.commitChaincodeDefinitionMutex.RUnlock() 324 return len(fake.commitChaincodeDefinitionArgsForCall) 325 } 326 327 func (fake *SCCFunctions) CommitChaincodeDefinitionCalls(stub func(string, string, *lifecycle.ChaincodeDefinition, lifecycle.ReadWritableState, []lifecycle.OpaqueState) (map[string]bool, error)) { 328 fake.commitChaincodeDefinitionMutex.Lock() 329 defer fake.commitChaincodeDefinitionMutex.Unlock() 330 fake.CommitChaincodeDefinitionStub = stub 331 } 332 333 func (fake *SCCFunctions) CommitChaincodeDefinitionArgsForCall(i int) (string, string, *lifecycle.ChaincodeDefinition, lifecycle.ReadWritableState, []lifecycle.OpaqueState) { 334 fake.commitChaincodeDefinitionMutex.RLock() 335 defer fake.commitChaincodeDefinitionMutex.RUnlock() 336 argsForCall := fake.commitChaincodeDefinitionArgsForCall[i] 337 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5 338 } 339 340 func (fake *SCCFunctions) CommitChaincodeDefinitionReturns(result1 map[string]bool, result2 error) { 341 fake.commitChaincodeDefinitionMutex.Lock() 342 defer fake.commitChaincodeDefinitionMutex.Unlock() 343 fake.CommitChaincodeDefinitionStub = nil 344 fake.commitChaincodeDefinitionReturns = struct { 345 result1 map[string]bool 346 result2 error 347 }{result1, result2} 348 } 349 350 func (fake *SCCFunctions) CommitChaincodeDefinitionReturnsOnCall(i int, result1 map[string]bool, result2 error) { 351 fake.commitChaincodeDefinitionMutex.Lock() 352 defer fake.commitChaincodeDefinitionMutex.Unlock() 353 fake.CommitChaincodeDefinitionStub = nil 354 if fake.commitChaincodeDefinitionReturnsOnCall == nil { 355 fake.commitChaincodeDefinitionReturnsOnCall = make(map[int]struct { 356 result1 map[string]bool 357 result2 error 358 }) 359 } 360 fake.commitChaincodeDefinitionReturnsOnCall[i] = struct { 361 result1 map[string]bool 362 result2 error 363 }{result1, result2} 364 } 365 366 func (fake *SCCFunctions) GetInstalledChaincodePackage(arg1 string) ([]byte, error) { 367 fake.getInstalledChaincodePackageMutex.Lock() 368 ret, specificReturn := fake.getInstalledChaincodePackageReturnsOnCall[len(fake.getInstalledChaincodePackageArgsForCall)] 369 fake.getInstalledChaincodePackageArgsForCall = append(fake.getInstalledChaincodePackageArgsForCall, struct { 370 arg1 string 371 }{arg1}) 372 fake.recordInvocation("GetInstalledChaincodePackage", []interface{}{arg1}) 373 fake.getInstalledChaincodePackageMutex.Unlock() 374 if fake.GetInstalledChaincodePackageStub != nil { 375 return fake.GetInstalledChaincodePackageStub(arg1) 376 } 377 if specificReturn { 378 return ret.result1, ret.result2 379 } 380 fakeReturns := fake.getInstalledChaincodePackageReturns 381 return fakeReturns.result1, fakeReturns.result2 382 } 383 384 func (fake *SCCFunctions) GetInstalledChaincodePackageCallCount() int { 385 fake.getInstalledChaincodePackageMutex.RLock() 386 defer fake.getInstalledChaincodePackageMutex.RUnlock() 387 return len(fake.getInstalledChaincodePackageArgsForCall) 388 } 389 390 func (fake *SCCFunctions) GetInstalledChaincodePackageCalls(stub func(string) ([]byte, error)) { 391 fake.getInstalledChaincodePackageMutex.Lock() 392 defer fake.getInstalledChaincodePackageMutex.Unlock() 393 fake.GetInstalledChaincodePackageStub = stub 394 } 395 396 func (fake *SCCFunctions) GetInstalledChaincodePackageArgsForCall(i int) string { 397 fake.getInstalledChaincodePackageMutex.RLock() 398 defer fake.getInstalledChaincodePackageMutex.RUnlock() 399 argsForCall := fake.getInstalledChaincodePackageArgsForCall[i] 400 return argsForCall.arg1 401 } 402 403 func (fake *SCCFunctions) GetInstalledChaincodePackageReturns(result1 []byte, result2 error) { 404 fake.getInstalledChaincodePackageMutex.Lock() 405 defer fake.getInstalledChaincodePackageMutex.Unlock() 406 fake.GetInstalledChaincodePackageStub = nil 407 fake.getInstalledChaincodePackageReturns = struct { 408 result1 []byte 409 result2 error 410 }{result1, result2} 411 } 412 413 func (fake *SCCFunctions) GetInstalledChaincodePackageReturnsOnCall(i int, result1 []byte, result2 error) { 414 fake.getInstalledChaincodePackageMutex.Lock() 415 defer fake.getInstalledChaincodePackageMutex.Unlock() 416 fake.GetInstalledChaincodePackageStub = nil 417 if fake.getInstalledChaincodePackageReturnsOnCall == nil { 418 fake.getInstalledChaincodePackageReturnsOnCall = make(map[int]struct { 419 result1 []byte 420 result2 error 421 }) 422 } 423 fake.getInstalledChaincodePackageReturnsOnCall[i] = struct { 424 result1 []byte 425 result2 error 426 }{result1, result2} 427 } 428 429 func (fake *SCCFunctions) InstallChaincode(arg1 []byte) (*chaincode.InstalledChaincode, error) { 430 var arg1Copy []byte 431 if arg1 != nil { 432 arg1Copy = make([]byte, len(arg1)) 433 copy(arg1Copy, arg1) 434 } 435 fake.installChaincodeMutex.Lock() 436 ret, specificReturn := fake.installChaincodeReturnsOnCall[len(fake.installChaincodeArgsForCall)] 437 fake.installChaincodeArgsForCall = append(fake.installChaincodeArgsForCall, struct { 438 arg1 []byte 439 }{arg1Copy}) 440 fake.recordInvocation("InstallChaincode", []interface{}{arg1Copy}) 441 fake.installChaincodeMutex.Unlock() 442 if fake.InstallChaincodeStub != nil { 443 return fake.InstallChaincodeStub(arg1) 444 } 445 if specificReturn { 446 return ret.result1, ret.result2 447 } 448 fakeReturns := fake.installChaincodeReturns 449 return fakeReturns.result1, fakeReturns.result2 450 } 451 452 func (fake *SCCFunctions) InstallChaincodeCallCount() int { 453 fake.installChaincodeMutex.RLock() 454 defer fake.installChaincodeMutex.RUnlock() 455 return len(fake.installChaincodeArgsForCall) 456 } 457 458 func (fake *SCCFunctions) InstallChaincodeCalls(stub func([]byte) (*chaincode.InstalledChaincode, error)) { 459 fake.installChaincodeMutex.Lock() 460 defer fake.installChaincodeMutex.Unlock() 461 fake.InstallChaincodeStub = stub 462 } 463 464 func (fake *SCCFunctions) InstallChaincodeArgsForCall(i int) []byte { 465 fake.installChaincodeMutex.RLock() 466 defer fake.installChaincodeMutex.RUnlock() 467 argsForCall := fake.installChaincodeArgsForCall[i] 468 return argsForCall.arg1 469 } 470 471 func (fake *SCCFunctions) InstallChaincodeReturns(result1 *chaincode.InstalledChaincode, result2 error) { 472 fake.installChaincodeMutex.Lock() 473 defer fake.installChaincodeMutex.Unlock() 474 fake.InstallChaincodeStub = nil 475 fake.installChaincodeReturns = struct { 476 result1 *chaincode.InstalledChaincode 477 result2 error 478 }{result1, result2} 479 } 480 481 func (fake *SCCFunctions) InstallChaincodeReturnsOnCall(i int, result1 *chaincode.InstalledChaincode, result2 error) { 482 fake.installChaincodeMutex.Lock() 483 defer fake.installChaincodeMutex.Unlock() 484 fake.InstallChaincodeStub = nil 485 if fake.installChaincodeReturnsOnCall == nil { 486 fake.installChaincodeReturnsOnCall = make(map[int]struct { 487 result1 *chaincode.InstalledChaincode 488 result2 error 489 }) 490 } 491 fake.installChaincodeReturnsOnCall[i] = struct { 492 result1 *chaincode.InstalledChaincode 493 result2 error 494 }{result1, result2} 495 } 496 497 func (fake *SCCFunctions) QueryChaincodeDefinition(arg1 string, arg2 lifecycle.ReadableState) (*lifecycle.ChaincodeDefinition, error) { 498 fake.queryChaincodeDefinitionMutex.Lock() 499 ret, specificReturn := fake.queryChaincodeDefinitionReturnsOnCall[len(fake.queryChaincodeDefinitionArgsForCall)] 500 fake.queryChaincodeDefinitionArgsForCall = append(fake.queryChaincodeDefinitionArgsForCall, struct { 501 arg1 string 502 arg2 lifecycle.ReadableState 503 }{arg1, arg2}) 504 fake.recordInvocation("QueryChaincodeDefinition", []interface{}{arg1, arg2}) 505 fake.queryChaincodeDefinitionMutex.Unlock() 506 if fake.QueryChaincodeDefinitionStub != nil { 507 return fake.QueryChaincodeDefinitionStub(arg1, arg2) 508 } 509 if specificReturn { 510 return ret.result1, ret.result2 511 } 512 fakeReturns := fake.queryChaincodeDefinitionReturns 513 return fakeReturns.result1, fakeReturns.result2 514 } 515 516 func (fake *SCCFunctions) QueryChaincodeDefinitionCallCount() int { 517 fake.queryChaincodeDefinitionMutex.RLock() 518 defer fake.queryChaincodeDefinitionMutex.RUnlock() 519 return len(fake.queryChaincodeDefinitionArgsForCall) 520 } 521 522 func (fake *SCCFunctions) QueryChaincodeDefinitionCalls(stub func(string, lifecycle.ReadableState) (*lifecycle.ChaincodeDefinition, error)) { 523 fake.queryChaincodeDefinitionMutex.Lock() 524 defer fake.queryChaincodeDefinitionMutex.Unlock() 525 fake.QueryChaincodeDefinitionStub = stub 526 } 527 528 func (fake *SCCFunctions) QueryChaincodeDefinitionArgsForCall(i int) (string, lifecycle.ReadableState) { 529 fake.queryChaincodeDefinitionMutex.RLock() 530 defer fake.queryChaincodeDefinitionMutex.RUnlock() 531 argsForCall := fake.queryChaincodeDefinitionArgsForCall[i] 532 return argsForCall.arg1, argsForCall.arg2 533 } 534 535 func (fake *SCCFunctions) QueryChaincodeDefinitionReturns(result1 *lifecycle.ChaincodeDefinition, result2 error) { 536 fake.queryChaincodeDefinitionMutex.Lock() 537 defer fake.queryChaincodeDefinitionMutex.Unlock() 538 fake.QueryChaincodeDefinitionStub = nil 539 fake.queryChaincodeDefinitionReturns = struct { 540 result1 *lifecycle.ChaincodeDefinition 541 result2 error 542 }{result1, result2} 543 } 544 545 func (fake *SCCFunctions) QueryChaincodeDefinitionReturnsOnCall(i int, result1 *lifecycle.ChaincodeDefinition, result2 error) { 546 fake.queryChaincodeDefinitionMutex.Lock() 547 defer fake.queryChaincodeDefinitionMutex.Unlock() 548 fake.QueryChaincodeDefinitionStub = nil 549 if fake.queryChaincodeDefinitionReturnsOnCall == nil { 550 fake.queryChaincodeDefinitionReturnsOnCall = make(map[int]struct { 551 result1 *lifecycle.ChaincodeDefinition 552 result2 error 553 }) 554 } 555 fake.queryChaincodeDefinitionReturnsOnCall[i] = struct { 556 result1 *lifecycle.ChaincodeDefinition 557 result2 error 558 }{result1, result2} 559 } 560 561 func (fake *SCCFunctions) QueryInstalledChaincode(arg1 string) (*chaincode.InstalledChaincode, error) { 562 fake.queryInstalledChaincodeMutex.Lock() 563 ret, specificReturn := fake.queryInstalledChaincodeReturnsOnCall[len(fake.queryInstalledChaincodeArgsForCall)] 564 fake.queryInstalledChaincodeArgsForCall = append(fake.queryInstalledChaincodeArgsForCall, struct { 565 arg1 string 566 }{arg1}) 567 fake.recordInvocation("QueryInstalledChaincode", []interface{}{arg1}) 568 fake.queryInstalledChaincodeMutex.Unlock() 569 if fake.QueryInstalledChaincodeStub != nil { 570 return fake.QueryInstalledChaincodeStub(arg1) 571 } 572 if specificReturn { 573 return ret.result1, ret.result2 574 } 575 fakeReturns := fake.queryInstalledChaincodeReturns 576 return fakeReturns.result1, fakeReturns.result2 577 } 578 579 func (fake *SCCFunctions) QueryInstalledChaincodeCallCount() int { 580 fake.queryInstalledChaincodeMutex.RLock() 581 defer fake.queryInstalledChaincodeMutex.RUnlock() 582 return len(fake.queryInstalledChaincodeArgsForCall) 583 } 584 585 func (fake *SCCFunctions) QueryInstalledChaincodeCalls(stub func(string) (*chaincode.InstalledChaincode, error)) { 586 fake.queryInstalledChaincodeMutex.Lock() 587 defer fake.queryInstalledChaincodeMutex.Unlock() 588 fake.QueryInstalledChaincodeStub = stub 589 } 590 591 func (fake *SCCFunctions) QueryInstalledChaincodeArgsForCall(i int) string { 592 fake.queryInstalledChaincodeMutex.RLock() 593 defer fake.queryInstalledChaincodeMutex.RUnlock() 594 argsForCall := fake.queryInstalledChaincodeArgsForCall[i] 595 return argsForCall.arg1 596 } 597 598 func (fake *SCCFunctions) QueryInstalledChaincodeReturns(result1 *chaincode.InstalledChaincode, result2 error) { 599 fake.queryInstalledChaincodeMutex.Lock() 600 defer fake.queryInstalledChaincodeMutex.Unlock() 601 fake.QueryInstalledChaincodeStub = nil 602 fake.queryInstalledChaincodeReturns = struct { 603 result1 *chaincode.InstalledChaincode 604 result2 error 605 }{result1, result2} 606 } 607 608 func (fake *SCCFunctions) QueryInstalledChaincodeReturnsOnCall(i int, result1 *chaincode.InstalledChaincode, result2 error) { 609 fake.queryInstalledChaincodeMutex.Lock() 610 defer fake.queryInstalledChaincodeMutex.Unlock() 611 fake.QueryInstalledChaincodeStub = nil 612 if fake.queryInstalledChaincodeReturnsOnCall == nil { 613 fake.queryInstalledChaincodeReturnsOnCall = make(map[int]struct { 614 result1 *chaincode.InstalledChaincode 615 result2 error 616 }) 617 } 618 fake.queryInstalledChaincodeReturnsOnCall[i] = struct { 619 result1 *chaincode.InstalledChaincode 620 result2 error 621 }{result1, result2} 622 } 623 624 func (fake *SCCFunctions) QueryInstalledChaincodes() []*chaincode.InstalledChaincode { 625 fake.queryInstalledChaincodesMutex.Lock() 626 ret, specificReturn := fake.queryInstalledChaincodesReturnsOnCall[len(fake.queryInstalledChaincodesArgsForCall)] 627 fake.queryInstalledChaincodesArgsForCall = append(fake.queryInstalledChaincodesArgsForCall, struct { 628 }{}) 629 fake.recordInvocation("QueryInstalledChaincodes", []interface{}{}) 630 fake.queryInstalledChaincodesMutex.Unlock() 631 if fake.QueryInstalledChaincodesStub != nil { 632 return fake.QueryInstalledChaincodesStub() 633 } 634 if specificReturn { 635 return ret.result1 636 } 637 fakeReturns := fake.queryInstalledChaincodesReturns 638 return fakeReturns.result1 639 } 640 641 func (fake *SCCFunctions) QueryInstalledChaincodesCallCount() int { 642 fake.queryInstalledChaincodesMutex.RLock() 643 defer fake.queryInstalledChaincodesMutex.RUnlock() 644 return len(fake.queryInstalledChaincodesArgsForCall) 645 } 646 647 func (fake *SCCFunctions) QueryInstalledChaincodesCalls(stub func() []*chaincode.InstalledChaincode) { 648 fake.queryInstalledChaincodesMutex.Lock() 649 defer fake.queryInstalledChaincodesMutex.Unlock() 650 fake.QueryInstalledChaincodesStub = stub 651 } 652 653 func (fake *SCCFunctions) QueryInstalledChaincodesReturns(result1 []*chaincode.InstalledChaincode) { 654 fake.queryInstalledChaincodesMutex.Lock() 655 defer fake.queryInstalledChaincodesMutex.Unlock() 656 fake.QueryInstalledChaincodesStub = nil 657 fake.queryInstalledChaincodesReturns = struct { 658 result1 []*chaincode.InstalledChaincode 659 }{result1} 660 } 661 662 func (fake *SCCFunctions) QueryInstalledChaincodesReturnsOnCall(i int, result1 []*chaincode.InstalledChaincode) { 663 fake.queryInstalledChaincodesMutex.Lock() 664 defer fake.queryInstalledChaincodesMutex.Unlock() 665 fake.QueryInstalledChaincodesStub = nil 666 if fake.queryInstalledChaincodesReturnsOnCall == nil { 667 fake.queryInstalledChaincodesReturnsOnCall = make(map[int]struct { 668 result1 []*chaincode.InstalledChaincode 669 }) 670 } 671 fake.queryInstalledChaincodesReturnsOnCall[i] = struct { 672 result1 []*chaincode.InstalledChaincode 673 }{result1} 674 } 675 676 func (fake *SCCFunctions) QueryNamespaceDefinitions(arg1 lifecycle.RangeableState) (map[string]string, error) { 677 fake.queryNamespaceDefinitionsMutex.Lock() 678 ret, specificReturn := fake.queryNamespaceDefinitionsReturnsOnCall[len(fake.queryNamespaceDefinitionsArgsForCall)] 679 fake.queryNamespaceDefinitionsArgsForCall = append(fake.queryNamespaceDefinitionsArgsForCall, struct { 680 arg1 lifecycle.RangeableState 681 }{arg1}) 682 fake.recordInvocation("QueryNamespaceDefinitions", []interface{}{arg1}) 683 fake.queryNamespaceDefinitionsMutex.Unlock() 684 if fake.QueryNamespaceDefinitionsStub != nil { 685 return fake.QueryNamespaceDefinitionsStub(arg1) 686 } 687 if specificReturn { 688 return ret.result1, ret.result2 689 } 690 fakeReturns := fake.queryNamespaceDefinitionsReturns 691 return fakeReturns.result1, fakeReturns.result2 692 } 693 694 func (fake *SCCFunctions) QueryNamespaceDefinitionsCallCount() int { 695 fake.queryNamespaceDefinitionsMutex.RLock() 696 defer fake.queryNamespaceDefinitionsMutex.RUnlock() 697 return len(fake.queryNamespaceDefinitionsArgsForCall) 698 } 699 700 func (fake *SCCFunctions) QueryNamespaceDefinitionsCalls(stub func(lifecycle.RangeableState) (map[string]string, error)) { 701 fake.queryNamespaceDefinitionsMutex.Lock() 702 defer fake.queryNamespaceDefinitionsMutex.Unlock() 703 fake.QueryNamespaceDefinitionsStub = stub 704 } 705 706 func (fake *SCCFunctions) QueryNamespaceDefinitionsArgsForCall(i int) lifecycle.RangeableState { 707 fake.queryNamespaceDefinitionsMutex.RLock() 708 defer fake.queryNamespaceDefinitionsMutex.RUnlock() 709 argsForCall := fake.queryNamespaceDefinitionsArgsForCall[i] 710 return argsForCall.arg1 711 } 712 713 func (fake *SCCFunctions) QueryNamespaceDefinitionsReturns(result1 map[string]string, result2 error) { 714 fake.queryNamespaceDefinitionsMutex.Lock() 715 defer fake.queryNamespaceDefinitionsMutex.Unlock() 716 fake.QueryNamespaceDefinitionsStub = nil 717 fake.queryNamespaceDefinitionsReturns = struct { 718 result1 map[string]string 719 result2 error 720 }{result1, result2} 721 } 722 723 func (fake *SCCFunctions) QueryNamespaceDefinitionsReturnsOnCall(i int, result1 map[string]string, result2 error) { 724 fake.queryNamespaceDefinitionsMutex.Lock() 725 defer fake.queryNamespaceDefinitionsMutex.Unlock() 726 fake.QueryNamespaceDefinitionsStub = nil 727 if fake.queryNamespaceDefinitionsReturnsOnCall == nil { 728 fake.queryNamespaceDefinitionsReturnsOnCall = make(map[int]struct { 729 result1 map[string]string 730 result2 error 731 }) 732 } 733 fake.queryNamespaceDefinitionsReturnsOnCall[i] = struct { 734 result1 map[string]string 735 result2 error 736 }{result1, result2} 737 } 738 739 func (fake *SCCFunctions) QueryOrgApprovals(arg1 string, arg2 *lifecycle.ChaincodeDefinition, arg3 []lifecycle.OpaqueState) (map[string]bool, error) { 740 var arg3Copy []lifecycle.OpaqueState 741 if arg3 != nil { 742 arg3Copy = make([]lifecycle.OpaqueState, len(arg3)) 743 copy(arg3Copy, arg3) 744 } 745 fake.queryOrgApprovalsMutex.Lock() 746 ret, specificReturn := fake.queryOrgApprovalsReturnsOnCall[len(fake.queryOrgApprovalsArgsForCall)] 747 fake.queryOrgApprovalsArgsForCall = append(fake.queryOrgApprovalsArgsForCall, struct { 748 arg1 string 749 arg2 *lifecycle.ChaincodeDefinition 750 arg3 []lifecycle.OpaqueState 751 }{arg1, arg2, arg3Copy}) 752 fake.recordInvocation("QueryOrgApprovals", []interface{}{arg1, arg2, arg3Copy}) 753 fake.queryOrgApprovalsMutex.Unlock() 754 if fake.QueryOrgApprovalsStub != nil { 755 return fake.QueryOrgApprovalsStub(arg1, arg2, arg3) 756 } 757 if specificReturn { 758 return ret.result1, ret.result2 759 } 760 fakeReturns := fake.queryOrgApprovalsReturns 761 return fakeReturns.result1, fakeReturns.result2 762 } 763 764 func (fake *SCCFunctions) QueryOrgApprovalsCallCount() int { 765 fake.queryOrgApprovalsMutex.RLock() 766 defer fake.queryOrgApprovalsMutex.RUnlock() 767 return len(fake.queryOrgApprovalsArgsForCall) 768 } 769 770 func (fake *SCCFunctions) QueryOrgApprovalsCalls(stub func(string, *lifecycle.ChaincodeDefinition, []lifecycle.OpaqueState) (map[string]bool, error)) { 771 fake.queryOrgApprovalsMutex.Lock() 772 defer fake.queryOrgApprovalsMutex.Unlock() 773 fake.QueryOrgApprovalsStub = stub 774 } 775 776 func (fake *SCCFunctions) QueryOrgApprovalsArgsForCall(i int) (string, *lifecycle.ChaincodeDefinition, []lifecycle.OpaqueState) { 777 fake.queryOrgApprovalsMutex.RLock() 778 defer fake.queryOrgApprovalsMutex.RUnlock() 779 argsForCall := fake.queryOrgApprovalsArgsForCall[i] 780 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 781 } 782 783 func (fake *SCCFunctions) QueryOrgApprovalsReturns(result1 map[string]bool, result2 error) { 784 fake.queryOrgApprovalsMutex.Lock() 785 defer fake.queryOrgApprovalsMutex.Unlock() 786 fake.QueryOrgApprovalsStub = nil 787 fake.queryOrgApprovalsReturns = struct { 788 result1 map[string]bool 789 result2 error 790 }{result1, result2} 791 } 792 793 func (fake *SCCFunctions) QueryOrgApprovalsReturnsOnCall(i int, result1 map[string]bool, result2 error) { 794 fake.queryOrgApprovalsMutex.Lock() 795 defer fake.queryOrgApprovalsMutex.Unlock() 796 fake.QueryOrgApprovalsStub = nil 797 if fake.queryOrgApprovalsReturnsOnCall == nil { 798 fake.queryOrgApprovalsReturnsOnCall = make(map[int]struct { 799 result1 map[string]bool 800 result2 error 801 }) 802 } 803 fake.queryOrgApprovalsReturnsOnCall[i] = struct { 804 result1 map[string]bool 805 result2 error 806 }{result1, result2} 807 } 808 809 func (fake *SCCFunctions) Invocations() map[string][][]interface{} { 810 fake.invocationsMutex.RLock() 811 defer fake.invocationsMutex.RUnlock() 812 fake.approveChaincodeDefinitionForOrgMutex.RLock() 813 defer fake.approveChaincodeDefinitionForOrgMutex.RUnlock() 814 fake.checkCommitReadinessMutex.RLock() 815 defer fake.checkCommitReadinessMutex.RUnlock() 816 fake.commitChaincodeDefinitionMutex.RLock() 817 defer fake.commitChaincodeDefinitionMutex.RUnlock() 818 fake.getInstalledChaincodePackageMutex.RLock() 819 defer fake.getInstalledChaincodePackageMutex.RUnlock() 820 fake.installChaincodeMutex.RLock() 821 defer fake.installChaincodeMutex.RUnlock() 822 fake.queryChaincodeDefinitionMutex.RLock() 823 defer fake.queryChaincodeDefinitionMutex.RUnlock() 824 fake.queryInstalledChaincodeMutex.RLock() 825 defer fake.queryInstalledChaincodeMutex.RUnlock() 826 fake.queryInstalledChaincodesMutex.RLock() 827 defer fake.queryInstalledChaincodesMutex.RUnlock() 828 fake.queryNamespaceDefinitionsMutex.RLock() 829 defer fake.queryNamespaceDefinitionsMutex.RUnlock() 830 fake.queryOrgApprovalsMutex.RLock() 831 defer fake.queryOrgApprovalsMutex.RUnlock() 832 copiedInvocations := map[string][][]interface{}{} 833 for key, value := range fake.invocations { 834 copiedInvocations[key] = value 835 } 836 return copiedInvocations 837 } 838 839 func (fake *SCCFunctions) recordInvocation(key string, args []interface{}) { 840 fake.invocationsMutex.Lock() 841 defer fake.invocationsMutex.Unlock() 842 if fake.invocations == nil { 843 fake.invocations = map[string][][]interface{}{} 844 } 845 if fake.invocations[key] == nil { 846 fake.invocations[key] = [][]interface{}{} 847 } 848 fake.invocations[key] = append(fake.invocations[key], args) 849 }