github.com/yacovm/fabric@v2.0.0-alpha.0.20191128145320-c5d4087dc723+incompatible/core/scc/mock/selfdescribingsyscc.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mock 3 4 import ( 5 "sync" 6 7 "github.com/hyperledger/fabric-chaincode-go/shim" 8 ) 9 10 type SelfDescribingSysCC struct { 11 ChaincodeStub func() shim.Chaincode 12 chaincodeMutex sync.RWMutex 13 chaincodeArgsForCall []struct { 14 } 15 chaincodeReturns struct { 16 result1 shim.Chaincode 17 } 18 chaincodeReturnsOnCall map[int]struct { 19 result1 shim.Chaincode 20 } 21 NameStub func() string 22 nameMutex sync.RWMutex 23 nameArgsForCall []struct { 24 } 25 nameReturns struct { 26 result1 string 27 } 28 nameReturnsOnCall map[int]struct { 29 result1 string 30 } 31 invocations map[string][][]interface{} 32 invocationsMutex sync.RWMutex 33 } 34 35 func (fake *SelfDescribingSysCC) Chaincode() shim.Chaincode { 36 fake.chaincodeMutex.Lock() 37 ret, specificReturn := fake.chaincodeReturnsOnCall[len(fake.chaincodeArgsForCall)] 38 fake.chaincodeArgsForCall = append(fake.chaincodeArgsForCall, struct { 39 }{}) 40 fake.recordInvocation("Chaincode", []interface{}{}) 41 fake.chaincodeMutex.Unlock() 42 if fake.ChaincodeStub != nil { 43 return fake.ChaincodeStub() 44 } 45 if specificReturn { 46 return ret.result1 47 } 48 fakeReturns := fake.chaincodeReturns 49 return fakeReturns.result1 50 } 51 52 func (fake *SelfDescribingSysCC) ChaincodeCallCount() int { 53 fake.chaincodeMutex.RLock() 54 defer fake.chaincodeMutex.RUnlock() 55 return len(fake.chaincodeArgsForCall) 56 } 57 58 func (fake *SelfDescribingSysCC) ChaincodeCalls(stub func() shim.Chaincode) { 59 fake.chaincodeMutex.Lock() 60 defer fake.chaincodeMutex.Unlock() 61 fake.ChaincodeStub = stub 62 } 63 64 func (fake *SelfDescribingSysCC) ChaincodeReturns(result1 shim.Chaincode) { 65 fake.chaincodeMutex.Lock() 66 defer fake.chaincodeMutex.Unlock() 67 fake.ChaincodeStub = nil 68 fake.chaincodeReturns = struct { 69 result1 shim.Chaincode 70 }{result1} 71 } 72 73 func (fake *SelfDescribingSysCC) ChaincodeReturnsOnCall(i int, result1 shim.Chaincode) { 74 fake.chaincodeMutex.Lock() 75 defer fake.chaincodeMutex.Unlock() 76 fake.ChaincodeStub = nil 77 if fake.chaincodeReturnsOnCall == nil { 78 fake.chaincodeReturnsOnCall = make(map[int]struct { 79 result1 shim.Chaincode 80 }) 81 } 82 fake.chaincodeReturnsOnCall[i] = struct { 83 result1 shim.Chaincode 84 }{result1} 85 } 86 87 func (fake *SelfDescribingSysCC) Name() string { 88 fake.nameMutex.Lock() 89 ret, specificReturn := fake.nameReturnsOnCall[len(fake.nameArgsForCall)] 90 fake.nameArgsForCall = append(fake.nameArgsForCall, struct { 91 }{}) 92 fake.recordInvocation("Name", []interface{}{}) 93 fake.nameMutex.Unlock() 94 if fake.NameStub != nil { 95 return fake.NameStub() 96 } 97 if specificReturn { 98 return ret.result1 99 } 100 fakeReturns := fake.nameReturns 101 return fakeReturns.result1 102 } 103 104 func (fake *SelfDescribingSysCC) NameCallCount() int { 105 fake.nameMutex.RLock() 106 defer fake.nameMutex.RUnlock() 107 return len(fake.nameArgsForCall) 108 } 109 110 func (fake *SelfDescribingSysCC) NameCalls(stub func() string) { 111 fake.nameMutex.Lock() 112 defer fake.nameMutex.Unlock() 113 fake.NameStub = stub 114 } 115 116 func (fake *SelfDescribingSysCC) NameReturns(result1 string) { 117 fake.nameMutex.Lock() 118 defer fake.nameMutex.Unlock() 119 fake.NameStub = nil 120 fake.nameReturns = struct { 121 result1 string 122 }{result1} 123 } 124 125 func (fake *SelfDescribingSysCC) NameReturnsOnCall(i int, result1 string) { 126 fake.nameMutex.Lock() 127 defer fake.nameMutex.Unlock() 128 fake.NameStub = nil 129 if fake.nameReturnsOnCall == nil { 130 fake.nameReturnsOnCall = make(map[int]struct { 131 result1 string 132 }) 133 } 134 fake.nameReturnsOnCall[i] = struct { 135 result1 string 136 }{result1} 137 } 138 139 func (fake *SelfDescribingSysCC) Invocations() map[string][][]interface{} { 140 fake.invocationsMutex.RLock() 141 defer fake.invocationsMutex.RUnlock() 142 fake.chaincodeMutex.RLock() 143 defer fake.chaincodeMutex.RUnlock() 144 fake.nameMutex.RLock() 145 defer fake.nameMutex.RUnlock() 146 copiedInvocations := map[string][][]interface{}{} 147 for key, value := range fake.invocations { 148 copiedInvocations[key] = value 149 } 150 return copiedInvocations 151 } 152 153 func (fake *SelfDescribingSysCC) recordInvocation(key string, args []interface{}) { 154 fake.invocationsMutex.Lock() 155 defer fake.invocationsMutex.Unlock() 156 if fake.invocations == nil { 157 fake.invocations = map[string][][]interface{}{} 158 } 159 if fake.invocations[key] == nil { 160 fake.invocations[key] = [][]interface{}{} 161 } 162 fake.invocations[key] = append(fake.invocations[key], args) 163 }