github.com/anjalikarhana/fabric@v2.1.1+incompatible/orderer/common/msgprocessor/mocks/channel_capabilities.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mocks 3 4 import ( 5 "sync" 6 7 "github.com/hyperledger/fabric/msp" 8 ) 9 10 type ChannelCapabilities struct { 11 ConsensusTypeMigrationStub func() bool 12 consensusTypeMigrationMutex sync.RWMutex 13 consensusTypeMigrationArgsForCall []struct { 14 } 15 consensusTypeMigrationReturns struct { 16 result1 bool 17 } 18 consensusTypeMigrationReturnsOnCall map[int]struct { 19 result1 bool 20 } 21 MSPVersionStub func() msp.MSPVersion 22 mSPVersionMutex sync.RWMutex 23 mSPVersionArgsForCall []struct { 24 } 25 mSPVersionReturns struct { 26 result1 msp.MSPVersion 27 } 28 mSPVersionReturnsOnCall map[int]struct { 29 result1 msp.MSPVersion 30 } 31 OrgSpecificOrdererEndpointsStub func() bool 32 orgSpecificOrdererEndpointsMutex sync.RWMutex 33 orgSpecificOrdererEndpointsArgsForCall []struct { 34 } 35 orgSpecificOrdererEndpointsReturns struct { 36 result1 bool 37 } 38 orgSpecificOrdererEndpointsReturnsOnCall map[int]struct { 39 result1 bool 40 } 41 SupportedStub func() error 42 supportedMutex sync.RWMutex 43 supportedArgsForCall []struct { 44 } 45 supportedReturns struct { 46 result1 error 47 } 48 supportedReturnsOnCall map[int]struct { 49 result1 error 50 } 51 invocations map[string][][]interface{} 52 invocationsMutex sync.RWMutex 53 } 54 55 func (fake *ChannelCapabilities) ConsensusTypeMigration() bool { 56 fake.consensusTypeMigrationMutex.Lock() 57 ret, specificReturn := fake.consensusTypeMigrationReturnsOnCall[len(fake.consensusTypeMigrationArgsForCall)] 58 fake.consensusTypeMigrationArgsForCall = append(fake.consensusTypeMigrationArgsForCall, struct { 59 }{}) 60 fake.recordInvocation("ConsensusTypeMigration", []interface{}{}) 61 fake.consensusTypeMigrationMutex.Unlock() 62 if fake.ConsensusTypeMigrationStub != nil { 63 return fake.ConsensusTypeMigrationStub() 64 } 65 if specificReturn { 66 return ret.result1 67 } 68 fakeReturns := fake.consensusTypeMigrationReturns 69 return fakeReturns.result1 70 } 71 72 func (fake *ChannelCapabilities) ConsensusTypeMigrationCallCount() int { 73 fake.consensusTypeMigrationMutex.RLock() 74 defer fake.consensusTypeMigrationMutex.RUnlock() 75 return len(fake.consensusTypeMigrationArgsForCall) 76 } 77 78 func (fake *ChannelCapabilities) ConsensusTypeMigrationCalls(stub func() bool) { 79 fake.consensusTypeMigrationMutex.Lock() 80 defer fake.consensusTypeMigrationMutex.Unlock() 81 fake.ConsensusTypeMigrationStub = stub 82 } 83 84 func (fake *ChannelCapabilities) ConsensusTypeMigrationReturns(result1 bool) { 85 fake.consensusTypeMigrationMutex.Lock() 86 defer fake.consensusTypeMigrationMutex.Unlock() 87 fake.ConsensusTypeMigrationStub = nil 88 fake.consensusTypeMigrationReturns = struct { 89 result1 bool 90 }{result1} 91 } 92 93 func (fake *ChannelCapabilities) ConsensusTypeMigrationReturnsOnCall(i int, result1 bool) { 94 fake.consensusTypeMigrationMutex.Lock() 95 defer fake.consensusTypeMigrationMutex.Unlock() 96 fake.ConsensusTypeMigrationStub = nil 97 if fake.consensusTypeMigrationReturnsOnCall == nil { 98 fake.consensusTypeMigrationReturnsOnCall = make(map[int]struct { 99 result1 bool 100 }) 101 } 102 fake.consensusTypeMigrationReturnsOnCall[i] = struct { 103 result1 bool 104 }{result1} 105 } 106 107 func (fake *ChannelCapabilities) MSPVersion() msp.MSPVersion { 108 fake.mSPVersionMutex.Lock() 109 ret, specificReturn := fake.mSPVersionReturnsOnCall[len(fake.mSPVersionArgsForCall)] 110 fake.mSPVersionArgsForCall = append(fake.mSPVersionArgsForCall, struct { 111 }{}) 112 fake.recordInvocation("MSPVersion", []interface{}{}) 113 fake.mSPVersionMutex.Unlock() 114 if fake.MSPVersionStub != nil { 115 return fake.MSPVersionStub() 116 } 117 if specificReturn { 118 return ret.result1 119 } 120 fakeReturns := fake.mSPVersionReturns 121 return fakeReturns.result1 122 } 123 124 func (fake *ChannelCapabilities) MSPVersionCallCount() int { 125 fake.mSPVersionMutex.RLock() 126 defer fake.mSPVersionMutex.RUnlock() 127 return len(fake.mSPVersionArgsForCall) 128 } 129 130 func (fake *ChannelCapabilities) MSPVersionCalls(stub func() msp.MSPVersion) { 131 fake.mSPVersionMutex.Lock() 132 defer fake.mSPVersionMutex.Unlock() 133 fake.MSPVersionStub = stub 134 } 135 136 func (fake *ChannelCapabilities) MSPVersionReturns(result1 msp.MSPVersion) { 137 fake.mSPVersionMutex.Lock() 138 defer fake.mSPVersionMutex.Unlock() 139 fake.MSPVersionStub = nil 140 fake.mSPVersionReturns = struct { 141 result1 msp.MSPVersion 142 }{result1} 143 } 144 145 func (fake *ChannelCapabilities) MSPVersionReturnsOnCall(i int, result1 msp.MSPVersion) { 146 fake.mSPVersionMutex.Lock() 147 defer fake.mSPVersionMutex.Unlock() 148 fake.MSPVersionStub = nil 149 if fake.mSPVersionReturnsOnCall == nil { 150 fake.mSPVersionReturnsOnCall = make(map[int]struct { 151 result1 msp.MSPVersion 152 }) 153 } 154 fake.mSPVersionReturnsOnCall[i] = struct { 155 result1 msp.MSPVersion 156 }{result1} 157 } 158 159 func (fake *ChannelCapabilities) OrgSpecificOrdererEndpoints() bool { 160 fake.orgSpecificOrdererEndpointsMutex.Lock() 161 ret, specificReturn := fake.orgSpecificOrdererEndpointsReturnsOnCall[len(fake.orgSpecificOrdererEndpointsArgsForCall)] 162 fake.orgSpecificOrdererEndpointsArgsForCall = append(fake.orgSpecificOrdererEndpointsArgsForCall, struct { 163 }{}) 164 fake.recordInvocation("OrgSpecificOrdererEndpoints", []interface{}{}) 165 fake.orgSpecificOrdererEndpointsMutex.Unlock() 166 if fake.OrgSpecificOrdererEndpointsStub != nil { 167 return fake.OrgSpecificOrdererEndpointsStub() 168 } 169 if specificReturn { 170 return ret.result1 171 } 172 fakeReturns := fake.orgSpecificOrdererEndpointsReturns 173 return fakeReturns.result1 174 } 175 176 func (fake *ChannelCapabilities) OrgSpecificOrdererEndpointsCallCount() int { 177 fake.orgSpecificOrdererEndpointsMutex.RLock() 178 defer fake.orgSpecificOrdererEndpointsMutex.RUnlock() 179 return len(fake.orgSpecificOrdererEndpointsArgsForCall) 180 } 181 182 func (fake *ChannelCapabilities) OrgSpecificOrdererEndpointsCalls(stub func() bool) { 183 fake.orgSpecificOrdererEndpointsMutex.Lock() 184 defer fake.orgSpecificOrdererEndpointsMutex.Unlock() 185 fake.OrgSpecificOrdererEndpointsStub = stub 186 } 187 188 func (fake *ChannelCapabilities) OrgSpecificOrdererEndpointsReturns(result1 bool) { 189 fake.orgSpecificOrdererEndpointsMutex.Lock() 190 defer fake.orgSpecificOrdererEndpointsMutex.Unlock() 191 fake.OrgSpecificOrdererEndpointsStub = nil 192 fake.orgSpecificOrdererEndpointsReturns = struct { 193 result1 bool 194 }{result1} 195 } 196 197 func (fake *ChannelCapabilities) OrgSpecificOrdererEndpointsReturnsOnCall(i int, result1 bool) { 198 fake.orgSpecificOrdererEndpointsMutex.Lock() 199 defer fake.orgSpecificOrdererEndpointsMutex.Unlock() 200 fake.OrgSpecificOrdererEndpointsStub = nil 201 if fake.orgSpecificOrdererEndpointsReturnsOnCall == nil { 202 fake.orgSpecificOrdererEndpointsReturnsOnCall = make(map[int]struct { 203 result1 bool 204 }) 205 } 206 fake.orgSpecificOrdererEndpointsReturnsOnCall[i] = struct { 207 result1 bool 208 }{result1} 209 } 210 211 func (fake *ChannelCapabilities) Supported() error { 212 fake.supportedMutex.Lock() 213 ret, specificReturn := fake.supportedReturnsOnCall[len(fake.supportedArgsForCall)] 214 fake.supportedArgsForCall = append(fake.supportedArgsForCall, struct { 215 }{}) 216 fake.recordInvocation("Supported", []interface{}{}) 217 fake.supportedMutex.Unlock() 218 if fake.SupportedStub != nil { 219 return fake.SupportedStub() 220 } 221 if specificReturn { 222 return ret.result1 223 } 224 fakeReturns := fake.supportedReturns 225 return fakeReturns.result1 226 } 227 228 func (fake *ChannelCapabilities) SupportedCallCount() int { 229 fake.supportedMutex.RLock() 230 defer fake.supportedMutex.RUnlock() 231 return len(fake.supportedArgsForCall) 232 } 233 234 func (fake *ChannelCapabilities) SupportedCalls(stub func() error) { 235 fake.supportedMutex.Lock() 236 defer fake.supportedMutex.Unlock() 237 fake.SupportedStub = stub 238 } 239 240 func (fake *ChannelCapabilities) SupportedReturns(result1 error) { 241 fake.supportedMutex.Lock() 242 defer fake.supportedMutex.Unlock() 243 fake.SupportedStub = nil 244 fake.supportedReturns = struct { 245 result1 error 246 }{result1} 247 } 248 249 func (fake *ChannelCapabilities) SupportedReturnsOnCall(i int, result1 error) { 250 fake.supportedMutex.Lock() 251 defer fake.supportedMutex.Unlock() 252 fake.SupportedStub = nil 253 if fake.supportedReturnsOnCall == nil { 254 fake.supportedReturnsOnCall = make(map[int]struct { 255 result1 error 256 }) 257 } 258 fake.supportedReturnsOnCall[i] = struct { 259 result1 error 260 }{result1} 261 } 262 263 func (fake *ChannelCapabilities) Invocations() map[string][][]interface{} { 264 fake.invocationsMutex.RLock() 265 defer fake.invocationsMutex.RUnlock() 266 fake.consensusTypeMigrationMutex.RLock() 267 defer fake.consensusTypeMigrationMutex.RUnlock() 268 fake.mSPVersionMutex.RLock() 269 defer fake.mSPVersionMutex.RUnlock() 270 fake.orgSpecificOrdererEndpointsMutex.RLock() 271 defer fake.orgSpecificOrdererEndpointsMutex.RUnlock() 272 fake.supportedMutex.RLock() 273 defer fake.supportedMutex.RUnlock() 274 copiedInvocations := map[string][][]interface{}{} 275 for key, value := range fake.invocations { 276 copiedInvocations[key] = value 277 } 278 return copiedInvocations 279 } 280 281 func (fake *ChannelCapabilities) recordInvocation(key string, args []interface{}) { 282 fake.invocationsMutex.Lock() 283 defer fake.invocationsMutex.Unlock() 284 if fake.invocations == nil { 285 fake.invocations = map[string][][]interface{}{} 286 } 287 if fake.invocations[key] == nil { 288 fake.invocations[key] = [][]interface{}{} 289 } 290 fake.invocations[key] = append(fake.invocations[key], args) 291 }