This repository has been archived by the owner on Mar 5, 2022. It is now read-only.
/
batchcontext.gen.go
192 lines (174 loc) · 5.47 KB
/
batchcontext.gen.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
182
183
184
185
186
187
188
189
190
191
192
// Code generated by counterfeiter. DO NOT EDIT.
package mocks
import (
"sync"
"github.com/trustbloc/sidetree-core-go/pkg/api/protocol"
"github.com/trustbloc/sidetree-core-go/pkg/batch"
"github.com/trustbloc/sidetree-core-go/pkg/batch/cutter"
)
type BatchContext struct {
ProtocolStub func() protocol.Client
protocolMutex sync.RWMutex
protocolArgsForCall []struct{}
protocolReturns struct {
result1 protocol.Client
}
protocolReturnsOnCall map[int]struct {
result1 protocol.Client
}
BlockchainStub func() batch.AnchorWriter
blockchainMutex sync.RWMutex
blockchainArgsForCall []struct{}
blockchainReturns struct {
result1 batch.AnchorWriter
}
blockchainReturnsOnCall map[int]struct {
result1 batch.AnchorWriter
}
OperationQueueStub func() cutter.OperationQueue
operationQueueMutex sync.RWMutex
operationQueueArgsForCall []struct{}
operationQueueReturns struct {
result1 cutter.OperationQueue
}
operationQueueReturnsOnCall map[int]struct {
result1 cutter.OperationQueue
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *BatchContext) Protocol() protocol.Client {
fake.protocolMutex.Lock()
ret, specificReturn := fake.protocolReturnsOnCall[len(fake.protocolArgsForCall)]
fake.protocolArgsForCall = append(fake.protocolArgsForCall, struct{}{})
fake.recordInvocation("Protocol", []interface{}{})
fake.protocolMutex.Unlock()
if fake.ProtocolStub != nil {
return fake.ProtocolStub()
}
if specificReturn {
return ret.result1
}
return fake.protocolReturns.result1
}
func (fake *BatchContext) ProtocolCallCount() int {
fake.protocolMutex.RLock()
defer fake.protocolMutex.RUnlock()
return len(fake.protocolArgsForCall)
}
func (fake *BatchContext) ProtocolReturns(result1 protocol.Client) {
fake.ProtocolStub = nil
fake.protocolReturns = struct {
result1 protocol.Client
}{result1}
}
func (fake *BatchContext) ProtocolReturnsOnCall(i int, result1 protocol.Client) {
fake.ProtocolStub = nil
if fake.protocolReturnsOnCall == nil {
fake.protocolReturnsOnCall = make(map[int]struct {
result1 protocol.Client
})
}
fake.protocolReturnsOnCall[i] = struct {
result1 protocol.Client
}{result1}
}
func (fake *BatchContext) Anchor() batch.AnchorWriter {
fake.blockchainMutex.Lock()
ret, specificReturn := fake.blockchainReturnsOnCall[len(fake.blockchainArgsForCall)]
fake.blockchainArgsForCall = append(fake.blockchainArgsForCall, struct{}{})
fake.recordInvocation("Anchor", []interface{}{})
fake.blockchainMutex.Unlock()
if fake.BlockchainStub != nil {
return fake.BlockchainStub()
}
if specificReturn {
return ret.result1
}
return fake.blockchainReturns.result1
}
func (fake *BatchContext) AnchorCallCount() int {
fake.blockchainMutex.RLock()
defer fake.blockchainMutex.RUnlock()
return len(fake.blockchainArgsForCall)
}
func (fake *BatchContext) AnchorReturns(result1 batch.AnchorWriter) {
fake.BlockchainStub = nil
fake.blockchainReturns = struct {
result1 batch.AnchorWriter
}{result1}
}
func (fake *BatchContext) AnchorReturnsOnCall(i int, result1 batch.AnchorWriter) {
fake.BlockchainStub = nil
if fake.blockchainReturnsOnCall == nil {
fake.blockchainReturnsOnCall = make(map[int]struct {
result1 batch.AnchorWriter
})
}
fake.blockchainReturnsOnCall[i] = struct {
result1 batch.AnchorWriter
}{result1}
}
func (fake *BatchContext) OperationQueue() cutter.OperationQueue {
fake.operationQueueMutex.Lock()
ret, specificReturn := fake.operationQueueReturnsOnCall[len(fake.operationQueueArgsForCall)]
fake.operationQueueArgsForCall = append(fake.operationQueueArgsForCall, struct{}{})
fake.recordInvocation("OperationQueue", []interface{}{})
fake.operationQueueMutex.Unlock()
if fake.OperationQueueStub != nil {
return fake.OperationQueueStub()
}
if specificReturn {
return ret.result1
}
return fake.operationQueueReturns.result1
}
func (fake *BatchContext) OperationQueueCallCount() int {
fake.operationQueueMutex.RLock()
defer fake.operationQueueMutex.RUnlock()
return len(fake.operationQueueArgsForCall)
}
func (fake *BatchContext) OperationQueueReturns(result1 cutter.OperationQueue) {
fake.OperationQueueStub = nil
fake.operationQueueReturns = struct {
result1 cutter.OperationQueue
}{result1}
}
func (fake *BatchContext) OperationQueueReturnsOnCall(i int, result1 cutter.OperationQueue) {
fake.OperationQueueStub = nil
if fake.operationQueueReturnsOnCall == nil {
fake.operationQueueReturnsOnCall = make(map[int]struct {
result1 cutter.OperationQueue
})
}
fake.operationQueueReturnsOnCall[i] = struct {
result1 cutter.OperationQueue
}{result1}
}
func (fake *BatchContext) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.protocolMutex.RLock()
defer fake.protocolMutex.RUnlock()
fake.blockchainMutex.RLock()
defer fake.blockchainMutex.RUnlock()
fake.operationQueueMutex.RLock()
defer fake.operationQueueMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *BatchContext) 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 _ batch.Context = new(BatchContext)