forked from hyperledger/fabric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
collection_store.go
218 lines (181 loc) · 6.4 KB
/
collection_store.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
// Code generated by mockery v2.34.2. DO NOT EDIT.
package mocks
import (
ledger "github.com/ZihuaZhang/fabric/core/ledger"
mock "github.com/stretchr/testify/mock"
peer "github.com/ZihuaZhang/fabric-protos-go/peer"
privdata "github.com/ZihuaZhang/fabric/core/common/privdata"
)
// CollectionStore is an autogenerated mock type for the CollectionStore type
type CollectionStore struct {
mock.Mock
}
// AccessFilter provides a mock function with given fields: channelName, collectionPolicyConfig
func (_m *CollectionStore) AccessFilter(channelName string, collectionPolicyConfig *peer.CollectionPolicyConfig) (privdata.Filter, error) {
ret := _m.Called(channelName, collectionPolicyConfig)
var r0 privdata.Filter
var r1 error
if rf, ok := ret.Get(0).(func(string, *peer.CollectionPolicyConfig) (privdata.Filter, error)); ok {
return rf(channelName, collectionPolicyConfig)
}
if rf, ok := ret.Get(0).(func(string, *peer.CollectionPolicyConfig) privdata.Filter); ok {
r0 = rf(channelName, collectionPolicyConfig)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(privdata.Filter)
}
}
if rf, ok := ret.Get(1).(func(string, *peer.CollectionPolicyConfig) error); ok {
r1 = rf(channelName, collectionPolicyConfig)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RetrieveCollection provides a mock function with given fields: _a0
func (_m *CollectionStore) RetrieveCollection(_a0 privdata.CollectionCriteria) (privdata.Collection, error) {
ret := _m.Called(_a0)
var r0 privdata.Collection
var r1 error
if rf, ok := ret.Get(0).(func(privdata.CollectionCriteria) (privdata.Collection, error)); ok {
return rf(_a0)
}
if rf, ok := ret.Get(0).(func(privdata.CollectionCriteria) privdata.Collection); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(privdata.Collection)
}
}
if rf, ok := ret.Get(1).(func(privdata.CollectionCriteria) error); ok {
r1 = rf(_a0)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RetrieveCollectionAccessPolicy provides a mock function with given fields: _a0
func (_m *CollectionStore) RetrieveCollectionAccessPolicy(_a0 privdata.CollectionCriteria) (privdata.CollectionAccessPolicy, error) {
ret := _m.Called(_a0)
var r0 privdata.CollectionAccessPolicy
var r1 error
if rf, ok := ret.Get(0).(func(privdata.CollectionCriteria) (privdata.CollectionAccessPolicy, error)); ok {
return rf(_a0)
}
if rf, ok := ret.Get(0).(func(privdata.CollectionCriteria) privdata.CollectionAccessPolicy); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(privdata.CollectionAccessPolicy)
}
}
if rf, ok := ret.Get(1).(func(privdata.CollectionCriteria) error); ok {
r1 = rf(_a0)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RetrieveCollectionConfig provides a mock function with given fields: _a0
func (_m *CollectionStore) RetrieveCollectionConfig(_a0 privdata.CollectionCriteria) (*peer.StaticCollectionConfig, error) {
ret := _m.Called(_a0)
var r0 *peer.StaticCollectionConfig
var r1 error
if rf, ok := ret.Get(0).(func(privdata.CollectionCriteria) (*peer.StaticCollectionConfig, error)); ok {
return rf(_a0)
}
if rf, ok := ret.Get(0).(func(privdata.CollectionCriteria) *peer.StaticCollectionConfig); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*peer.StaticCollectionConfig)
}
}
if rf, ok := ret.Get(1).(func(privdata.CollectionCriteria) error); ok {
r1 = rf(_a0)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RetrieveCollectionConfigPackage provides a mock function with given fields: _a0
func (_m *CollectionStore) RetrieveCollectionConfigPackage(_a0 privdata.CollectionCriteria) (*peer.CollectionConfigPackage, error) {
ret := _m.Called(_a0)
var r0 *peer.CollectionConfigPackage
var r1 error
if rf, ok := ret.Get(0).(func(privdata.CollectionCriteria) (*peer.CollectionConfigPackage, error)); ok {
return rf(_a0)
}
if rf, ok := ret.Get(0).(func(privdata.CollectionCriteria) *peer.CollectionConfigPackage); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*peer.CollectionConfigPackage)
}
}
if rf, ok := ret.Get(1).(func(privdata.CollectionCriteria) error); ok {
r1 = rf(_a0)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RetrieveCollectionPersistenceConfigs provides a mock function with given fields: _a0
func (_m *CollectionStore) RetrieveCollectionPersistenceConfigs(_a0 privdata.CollectionCriteria) (privdata.CollectionPersistenceConfigs, error) {
ret := _m.Called(_a0)
var r0 privdata.CollectionPersistenceConfigs
var r1 error
if rf, ok := ret.Get(0).(func(privdata.CollectionCriteria) (privdata.CollectionPersistenceConfigs, error)); ok {
return rf(_a0)
}
if rf, ok := ret.Get(0).(func(privdata.CollectionCriteria) privdata.CollectionPersistenceConfigs); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(privdata.CollectionPersistenceConfigs)
}
}
if rf, ok := ret.Get(1).(func(privdata.CollectionCriteria) error); ok {
r1 = rf(_a0)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RetrieveReadWritePermission provides a mock function with given fields: _a0, _a1, _a2
func (_m *CollectionStore) RetrieveReadWritePermission(_a0 privdata.CollectionCriteria, _a1 *peer.SignedProposal, _a2 ledger.QueryExecutor) (bool, bool, error) {
ret := _m.Called(_a0, _a1, _a2)
var r0 bool
var r1 bool
var r2 error
if rf, ok := ret.Get(0).(func(privdata.CollectionCriteria, *peer.SignedProposal, ledger.QueryExecutor) (bool, bool, error)); ok {
return rf(_a0, _a1, _a2)
}
if rf, ok := ret.Get(0).(func(privdata.CollectionCriteria, *peer.SignedProposal, ledger.QueryExecutor) bool); ok {
r0 = rf(_a0, _a1, _a2)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(privdata.CollectionCriteria, *peer.SignedProposal, ledger.QueryExecutor) bool); ok {
r1 = rf(_a0, _a1, _a2)
} else {
r1 = ret.Get(1).(bool)
}
if rf, ok := ret.Get(2).(func(privdata.CollectionCriteria, *peer.SignedProposal, ledger.QueryExecutor) error); ok {
r2 = rf(_a0, _a1, _a2)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// NewCollectionStore creates a new instance of CollectionStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewCollectionStore(t interface {
mock.TestingT
Cleanup(func())
}) *CollectionStore {
mock := &CollectionStore{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}