-
Notifications
You must be signed in to change notification settings - Fork 8.8k
/
installed_chaincodes_lister.go
180 lines (163 loc) · 6.4 KB
/
installed_chaincodes_lister.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
"sync"
"github.com/hyperledger/fabric/common/chaincode"
"github.com/hyperledger/fabric/core/chaincode/lifecycle"
)
type InstalledChaincodesLister struct {
GetInstalledChaincodeStub func(string) (*chaincode.InstalledChaincode, error)
getInstalledChaincodeMutex sync.RWMutex
getInstalledChaincodeArgsForCall []struct {
arg1 string
}
getInstalledChaincodeReturns struct {
result1 *chaincode.InstalledChaincode
result2 error
}
getInstalledChaincodeReturnsOnCall map[int]struct {
result1 *chaincode.InstalledChaincode
result2 error
}
ListInstalledChaincodesStub func() []*chaincode.InstalledChaincode
listInstalledChaincodesMutex sync.RWMutex
listInstalledChaincodesArgsForCall []struct {
}
listInstalledChaincodesReturns struct {
result1 []*chaincode.InstalledChaincode
}
listInstalledChaincodesReturnsOnCall map[int]struct {
result1 []*chaincode.InstalledChaincode
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *InstalledChaincodesLister) GetInstalledChaincode(arg1 string) (*chaincode.InstalledChaincode, error) {
fake.getInstalledChaincodeMutex.Lock()
ret, specificReturn := fake.getInstalledChaincodeReturnsOnCall[len(fake.getInstalledChaincodeArgsForCall)]
fake.getInstalledChaincodeArgsForCall = append(fake.getInstalledChaincodeArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("GetInstalledChaincode", []interface{}{arg1})
fake.getInstalledChaincodeMutex.Unlock()
if fake.GetInstalledChaincodeStub != nil {
return fake.GetInstalledChaincodeStub(arg1)
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.getInstalledChaincodeReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *InstalledChaincodesLister) GetInstalledChaincodeCallCount() int {
fake.getInstalledChaincodeMutex.RLock()
defer fake.getInstalledChaincodeMutex.RUnlock()
return len(fake.getInstalledChaincodeArgsForCall)
}
func (fake *InstalledChaincodesLister) GetInstalledChaincodeCalls(stub func(string) (*chaincode.InstalledChaincode, error)) {
fake.getInstalledChaincodeMutex.Lock()
defer fake.getInstalledChaincodeMutex.Unlock()
fake.GetInstalledChaincodeStub = stub
}
func (fake *InstalledChaincodesLister) GetInstalledChaincodeArgsForCall(i int) string {
fake.getInstalledChaincodeMutex.RLock()
defer fake.getInstalledChaincodeMutex.RUnlock()
argsForCall := fake.getInstalledChaincodeArgsForCall[i]
return argsForCall.arg1
}
func (fake *InstalledChaincodesLister) GetInstalledChaincodeReturns(result1 *chaincode.InstalledChaincode, result2 error) {
fake.getInstalledChaincodeMutex.Lock()
defer fake.getInstalledChaincodeMutex.Unlock()
fake.GetInstalledChaincodeStub = nil
fake.getInstalledChaincodeReturns = struct {
result1 *chaincode.InstalledChaincode
result2 error
}{result1, result2}
}
func (fake *InstalledChaincodesLister) GetInstalledChaincodeReturnsOnCall(i int, result1 *chaincode.InstalledChaincode, result2 error) {
fake.getInstalledChaincodeMutex.Lock()
defer fake.getInstalledChaincodeMutex.Unlock()
fake.GetInstalledChaincodeStub = nil
if fake.getInstalledChaincodeReturnsOnCall == nil {
fake.getInstalledChaincodeReturnsOnCall = make(map[int]struct {
result1 *chaincode.InstalledChaincode
result2 error
})
}
fake.getInstalledChaincodeReturnsOnCall[i] = struct {
result1 *chaincode.InstalledChaincode
result2 error
}{result1, result2}
}
func (fake *InstalledChaincodesLister) ListInstalledChaincodes() []*chaincode.InstalledChaincode {
fake.listInstalledChaincodesMutex.Lock()
ret, specificReturn := fake.listInstalledChaincodesReturnsOnCall[len(fake.listInstalledChaincodesArgsForCall)]
fake.listInstalledChaincodesArgsForCall = append(fake.listInstalledChaincodesArgsForCall, struct {
}{})
fake.recordInvocation("ListInstalledChaincodes", []interface{}{})
fake.listInstalledChaincodesMutex.Unlock()
if fake.ListInstalledChaincodesStub != nil {
return fake.ListInstalledChaincodesStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.listInstalledChaincodesReturns
return fakeReturns.result1
}
func (fake *InstalledChaincodesLister) ListInstalledChaincodesCallCount() int {
fake.listInstalledChaincodesMutex.RLock()
defer fake.listInstalledChaincodesMutex.RUnlock()
return len(fake.listInstalledChaincodesArgsForCall)
}
func (fake *InstalledChaincodesLister) ListInstalledChaincodesCalls(stub func() []*chaincode.InstalledChaincode) {
fake.listInstalledChaincodesMutex.Lock()
defer fake.listInstalledChaincodesMutex.Unlock()
fake.ListInstalledChaincodesStub = stub
}
func (fake *InstalledChaincodesLister) ListInstalledChaincodesReturns(result1 []*chaincode.InstalledChaincode) {
fake.listInstalledChaincodesMutex.Lock()
defer fake.listInstalledChaincodesMutex.Unlock()
fake.ListInstalledChaincodesStub = nil
fake.listInstalledChaincodesReturns = struct {
result1 []*chaincode.InstalledChaincode
}{result1}
}
func (fake *InstalledChaincodesLister) ListInstalledChaincodesReturnsOnCall(i int, result1 []*chaincode.InstalledChaincode) {
fake.listInstalledChaincodesMutex.Lock()
defer fake.listInstalledChaincodesMutex.Unlock()
fake.ListInstalledChaincodesStub = nil
if fake.listInstalledChaincodesReturnsOnCall == nil {
fake.listInstalledChaincodesReturnsOnCall = make(map[int]struct {
result1 []*chaincode.InstalledChaincode
})
}
fake.listInstalledChaincodesReturnsOnCall[i] = struct {
result1 []*chaincode.InstalledChaincode
}{result1}
}
func (fake *InstalledChaincodesLister) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.getInstalledChaincodeMutex.RLock()
defer fake.getInstalledChaincodeMutex.RUnlock()
fake.listInstalledChaincodesMutex.RLock()
defer fake.listInstalledChaincodesMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *InstalledChaincodesLister) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ lifecycle.InstalledChaincodesLister = new(InstalledChaincodesLister)