forked from hyperledger/fabric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chaincode_stream_handler.go
181 lines (164 loc) · 5.62 KB
/
chaincode_stream_handler.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
181
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
"sync"
"github.com/hyperledger/fabric/core/container/ccintf"
)
type ChaincodeStreamHandler struct {
HandleChaincodeStreamStub func(ccintf.ChaincodeStream) error
handleChaincodeStreamMutex sync.RWMutex
handleChaincodeStreamArgsForCall []struct {
arg1 ccintf.ChaincodeStream
}
handleChaincodeStreamReturns struct {
result1 error
}
handleChaincodeStreamReturnsOnCall map[int]struct {
result1 error
}
LaunchInProcStub func(string) <-chan struct{}
launchInProcMutex sync.RWMutex
launchInProcArgsForCall []struct {
arg1 string
}
launchInProcReturns struct {
result1 <-chan struct{}
}
launchInProcReturnsOnCall map[int]struct {
result1 <-chan struct{}
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *ChaincodeStreamHandler) HandleChaincodeStream(arg1 ccintf.ChaincodeStream) error {
fake.handleChaincodeStreamMutex.Lock()
ret, specificReturn := fake.handleChaincodeStreamReturnsOnCall[len(fake.handleChaincodeStreamArgsForCall)]
fake.handleChaincodeStreamArgsForCall = append(fake.handleChaincodeStreamArgsForCall, struct {
arg1 ccintf.ChaincodeStream
}{arg1})
fake.recordInvocation("HandleChaincodeStream", []interface{}{arg1})
fake.handleChaincodeStreamMutex.Unlock()
if fake.HandleChaincodeStreamStub != nil {
return fake.HandleChaincodeStreamStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.handleChaincodeStreamReturns
return fakeReturns.result1
}
func (fake *ChaincodeStreamHandler) HandleChaincodeStreamCallCount() int {
fake.handleChaincodeStreamMutex.RLock()
defer fake.handleChaincodeStreamMutex.RUnlock()
return len(fake.handleChaincodeStreamArgsForCall)
}
func (fake *ChaincodeStreamHandler) HandleChaincodeStreamCalls(stub func(ccintf.ChaincodeStream) error) {
fake.handleChaincodeStreamMutex.Lock()
defer fake.handleChaincodeStreamMutex.Unlock()
fake.HandleChaincodeStreamStub = stub
}
func (fake *ChaincodeStreamHandler) HandleChaincodeStreamArgsForCall(i int) ccintf.ChaincodeStream {
fake.handleChaincodeStreamMutex.RLock()
defer fake.handleChaincodeStreamMutex.RUnlock()
argsForCall := fake.handleChaincodeStreamArgsForCall[i]
return argsForCall.arg1
}
func (fake *ChaincodeStreamHandler) HandleChaincodeStreamReturns(result1 error) {
fake.handleChaincodeStreamMutex.Lock()
defer fake.handleChaincodeStreamMutex.Unlock()
fake.HandleChaincodeStreamStub = nil
fake.handleChaincodeStreamReturns = struct {
result1 error
}{result1}
}
func (fake *ChaincodeStreamHandler) HandleChaincodeStreamReturnsOnCall(i int, result1 error) {
fake.handleChaincodeStreamMutex.Lock()
defer fake.handleChaincodeStreamMutex.Unlock()
fake.HandleChaincodeStreamStub = nil
if fake.handleChaincodeStreamReturnsOnCall == nil {
fake.handleChaincodeStreamReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.handleChaincodeStreamReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *ChaincodeStreamHandler) LaunchInProc(arg1 string) <-chan struct{} {
fake.launchInProcMutex.Lock()
ret, specificReturn := fake.launchInProcReturnsOnCall[len(fake.launchInProcArgsForCall)]
fake.launchInProcArgsForCall = append(fake.launchInProcArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("LaunchInProc", []interface{}{arg1})
fake.launchInProcMutex.Unlock()
if fake.LaunchInProcStub != nil {
return fake.LaunchInProcStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.launchInProcReturns
return fakeReturns.result1
}
func (fake *ChaincodeStreamHandler) LaunchInProcCallCount() int {
fake.launchInProcMutex.RLock()
defer fake.launchInProcMutex.RUnlock()
return len(fake.launchInProcArgsForCall)
}
func (fake *ChaincodeStreamHandler) LaunchInProcCalls(stub func(string) <-chan struct{}) {
fake.launchInProcMutex.Lock()
defer fake.launchInProcMutex.Unlock()
fake.LaunchInProcStub = stub
}
func (fake *ChaincodeStreamHandler) LaunchInProcArgsForCall(i int) string {
fake.launchInProcMutex.RLock()
defer fake.launchInProcMutex.RUnlock()
argsForCall := fake.launchInProcArgsForCall[i]
return argsForCall.arg1
}
func (fake *ChaincodeStreamHandler) LaunchInProcReturns(result1 <-chan struct{}) {
fake.launchInProcMutex.Lock()
defer fake.launchInProcMutex.Unlock()
fake.LaunchInProcStub = nil
fake.launchInProcReturns = struct {
result1 <-chan struct{}
}{result1}
}
func (fake *ChaincodeStreamHandler) LaunchInProcReturnsOnCall(i int, result1 <-chan struct{}) {
fake.launchInProcMutex.Lock()
defer fake.launchInProcMutex.Unlock()
fake.LaunchInProcStub = nil
if fake.launchInProcReturnsOnCall == nil {
fake.launchInProcReturnsOnCall = make(map[int]struct {
result1 <-chan struct{}
})
}
fake.launchInProcReturnsOnCall[i] = struct {
result1 <-chan struct{}
}{result1}
}
func (fake *ChaincodeStreamHandler) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.handleChaincodeStreamMutex.RLock()
defer fake.handleChaincodeStreamMutex.RUnlock()
fake.launchInProcMutex.RLock()
defer fake.launchInProcMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *ChaincodeStreamHandler) 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)
}