github.com/defanghe/fabric@v2.1.1+incompatible/core/chaincode/fake/launch_registry.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package fake 3 4 import ( 5 "sync" 6 7 "github.com/hyperledger/fabric/core/chaincode" 8 ) 9 10 type LaunchRegistry struct { 11 DeregisterStub func(string) error 12 deregisterMutex sync.RWMutex 13 deregisterArgsForCall []struct { 14 arg1 string 15 } 16 deregisterReturns struct { 17 result1 error 18 } 19 deregisterReturnsOnCall map[int]struct { 20 result1 error 21 } 22 LaunchingStub func(string) (*chaincode.LaunchState, bool) 23 launchingMutex sync.RWMutex 24 launchingArgsForCall []struct { 25 arg1 string 26 } 27 launchingReturns struct { 28 result1 *chaincode.LaunchState 29 result2 bool 30 } 31 launchingReturnsOnCall map[int]struct { 32 result1 *chaincode.LaunchState 33 result2 bool 34 } 35 invocations map[string][][]interface{} 36 invocationsMutex sync.RWMutex 37 } 38 39 func (fake *LaunchRegistry) Deregister(arg1 string) error { 40 fake.deregisterMutex.Lock() 41 ret, specificReturn := fake.deregisterReturnsOnCall[len(fake.deregisterArgsForCall)] 42 fake.deregisterArgsForCall = append(fake.deregisterArgsForCall, struct { 43 arg1 string 44 }{arg1}) 45 fake.recordInvocation("Deregister", []interface{}{arg1}) 46 fake.deregisterMutex.Unlock() 47 if fake.DeregisterStub != nil { 48 return fake.DeregisterStub(arg1) 49 } 50 if specificReturn { 51 return ret.result1 52 } 53 fakeReturns := fake.deregisterReturns 54 return fakeReturns.result1 55 } 56 57 func (fake *LaunchRegistry) DeregisterCallCount() int { 58 fake.deregisterMutex.RLock() 59 defer fake.deregisterMutex.RUnlock() 60 return len(fake.deregisterArgsForCall) 61 } 62 63 func (fake *LaunchRegistry) DeregisterCalls(stub func(string) error) { 64 fake.deregisterMutex.Lock() 65 defer fake.deregisterMutex.Unlock() 66 fake.DeregisterStub = stub 67 } 68 69 func (fake *LaunchRegistry) DeregisterArgsForCall(i int) string { 70 fake.deregisterMutex.RLock() 71 defer fake.deregisterMutex.RUnlock() 72 argsForCall := fake.deregisterArgsForCall[i] 73 return argsForCall.arg1 74 } 75 76 func (fake *LaunchRegistry) DeregisterReturns(result1 error) { 77 fake.deregisterMutex.Lock() 78 defer fake.deregisterMutex.Unlock() 79 fake.DeregisterStub = nil 80 fake.deregisterReturns = struct { 81 result1 error 82 }{result1} 83 } 84 85 func (fake *LaunchRegistry) DeregisterReturnsOnCall(i int, result1 error) { 86 fake.deregisterMutex.Lock() 87 defer fake.deregisterMutex.Unlock() 88 fake.DeregisterStub = nil 89 if fake.deregisterReturnsOnCall == nil { 90 fake.deregisterReturnsOnCall = make(map[int]struct { 91 result1 error 92 }) 93 } 94 fake.deregisterReturnsOnCall[i] = struct { 95 result1 error 96 }{result1} 97 } 98 99 func (fake *LaunchRegistry) Launching(arg1 string) (*chaincode.LaunchState, bool) { 100 fake.launchingMutex.Lock() 101 ret, specificReturn := fake.launchingReturnsOnCall[len(fake.launchingArgsForCall)] 102 fake.launchingArgsForCall = append(fake.launchingArgsForCall, struct { 103 arg1 string 104 }{arg1}) 105 fake.recordInvocation("Launching", []interface{}{arg1}) 106 fake.launchingMutex.Unlock() 107 if fake.LaunchingStub != nil { 108 return fake.LaunchingStub(arg1) 109 } 110 if specificReturn { 111 return ret.result1, ret.result2 112 } 113 fakeReturns := fake.launchingReturns 114 return fakeReturns.result1, fakeReturns.result2 115 } 116 117 func (fake *LaunchRegistry) LaunchingCallCount() int { 118 fake.launchingMutex.RLock() 119 defer fake.launchingMutex.RUnlock() 120 return len(fake.launchingArgsForCall) 121 } 122 123 func (fake *LaunchRegistry) LaunchingCalls(stub func(string) (*chaincode.LaunchState, bool)) { 124 fake.launchingMutex.Lock() 125 defer fake.launchingMutex.Unlock() 126 fake.LaunchingStub = stub 127 } 128 129 func (fake *LaunchRegistry) LaunchingArgsForCall(i int) string { 130 fake.launchingMutex.RLock() 131 defer fake.launchingMutex.RUnlock() 132 argsForCall := fake.launchingArgsForCall[i] 133 return argsForCall.arg1 134 } 135 136 func (fake *LaunchRegistry) LaunchingReturns(result1 *chaincode.LaunchState, result2 bool) { 137 fake.launchingMutex.Lock() 138 defer fake.launchingMutex.Unlock() 139 fake.LaunchingStub = nil 140 fake.launchingReturns = struct { 141 result1 *chaincode.LaunchState 142 result2 bool 143 }{result1, result2} 144 } 145 146 func (fake *LaunchRegistry) LaunchingReturnsOnCall(i int, result1 *chaincode.LaunchState, result2 bool) { 147 fake.launchingMutex.Lock() 148 defer fake.launchingMutex.Unlock() 149 fake.LaunchingStub = nil 150 if fake.launchingReturnsOnCall == nil { 151 fake.launchingReturnsOnCall = make(map[int]struct { 152 result1 *chaincode.LaunchState 153 result2 bool 154 }) 155 } 156 fake.launchingReturnsOnCall[i] = struct { 157 result1 *chaincode.LaunchState 158 result2 bool 159 }{result1, result2} 160 } 161 162 func (fake *LaunchRegistry) Invocations() map[string][][]interface{} { 163 fake.invocationsMutex.RLock() 164 defer fake.invocationsMutex.RUnlock() 165 fake.deregisterMutex.RLock() 166 defer fake.deregisterMutex.RUnlock() 167 fake.launchingMutex.RLock() 168 defer fake.launchingMutex.RUnlock() 169 copiedInvocations := map[string][][]interface{}{} 170 for key, value := range fake.invocations { 171 copiedInvocations[key] = value 172 } 173 return copiedInvocations 174 } 175 176 func (fake *LaunchRegistry) recordInvocation(key string, args []interface{}) { 177 fake.invocationsMutex.Lock() 178 defer fake.invocationsMutex.Unlock() 179 if fake.invocations == nil { 180 fake.invocations = map[string][][]interface{}{} 181 } 182 if fake.invocations[key] == nil { 183 fake.invocations[key] = [][]interface{}{} 184 } 185 fake.invocations[key] = append(fake.invocations[key], args) 186 }