-
Notifications
You must be signed in to change notification settings - Fork 8.8k
/
committer.go
204 lines (166 loc) · 4.84 KB
/
committer.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
// Code generated by mockery v1.0.0. DO NOT EDIT.
package mocks
import common "github.com/hyperledger/fabric/protos/common"
import ledger "github.com/hyperledger/fabric/core/ledger"
import mock "github.com/stretchr/testify/mock"
// Committer is an autogenerated mock type for the Committer type
type Committer struct {
mock.Mock
}
// Close provides a mock function with given fields:
func (_m *Committer) Close() {
_m.Called()
}
// CommitPvtDataOfOldBlocks provides a mock function with given fields: blockPvtData
func (_m *Committer) CommitPvtDataOfOldBlocks(blockPvtData []*ledger.BlockPvtData) ([]*ledger.PvtdataHashMismatch, error) {
ret := _m.Called(blockPvtData)
var r0 []*ledger.PvtdataHashMismatch
if rf, ok := ret.Get(0).(func([]*ledger.BlockPvtData) []*ledger.PvtdataHashMismatch); ok {
r0 = rf(blockPvtData)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*ledger.PvtdataHashMismatch)
}
}
var r1 error
if rf, ok := ret.Get(1).(func([]*ledger.BlockPvtData) error); ok {
r1 = rf(blockPvtData)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CommitWithPvtData provides a mock function with given fields: blockAndPvtData, commitOpts
func (_m *Committer) CommitWithPvtData(blockAndPvtData *ledger.BlockAndPvtData, commitOpts *ledger.CommitOptions) error {
ret := _m.Called(blockAndPvtData, commitOpts)
var r0 error
if rf, ok := ret.Get(0).(func(*ledger.BlockAndPvtData, *ledger.CommitOptions) error); ok {
r0 = rf(blockAndPvtData, commitOpts)
} else {
r0 = ret.Error(0)
}
return r0
}
// DoesPvtDataInfoExistInLedger provides a mock function with given fields: blockNum
func (_m *Committer) DoesPvtDataInfoExistInLedger(blockNum uint64) (bool, error) {
ret := _m.Called(blockNum)
var r0 bool
if rf, ok := ret.Get(0).(func(uint64) bool); ok {
r0 = rf(blockNum)
} else {
r0 = ret.Get(0).(bool)
}
var r1 error
if rf, ok := ret.Get(1).(func(uint64) error); ok {
r1 = rf(blockNum)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetBlocks provides a mock function with given fields: blockSeqs
func (_m *Committer) GetBlocks(blockSeqs []uint64) []*common.Block {
ret := _m.Called(blockSeqs)
var r0 []*common.Block
if rf, ok := ret.Get(0).(func([]uint64) []*common.Block); ok {
r0 = rf(blockSeqs)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*common.Block)
}
}
return r0
}
// GetConfigHistoryRetriever provides a mock function with given fields:
func (_m *Committer) GetConfigHistoryRetriever() (ledger.ConfigHistoryRetriever, error) {
ret := _m.Called()
var r0 ledger.ConfigHistoryRetriever
if rf, ok := ret.Get(0).(func() ledger.ConfigHistoryRetriever); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(ledger.ConfigHistoryRetriever)
}
}
var r1 error
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetMissingPvtDataTracker provides a mock function with given fields:
func (_m *Committer) GetMissingPvtDataTracker() (ledger.MissingPvtDataTracker, error) {
ret := _m.Called()
var r0 ledger.MissingPvtDataTracker
if rf, ok := ret.Get(0).(func() ledger.MissingPvtDataTracker); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(ledger.MissingPvtDataTracker)
}
}
var r1 error
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetPvtDataAndBlockByNum provides a mock function with given fields: seqNum
func (_m *Committer) GetPvtDataAndBlockByNum(seqNum uint64) (*ledger.BlockAndPvtData, error) {
ret := _m.Called(seqNum)
var r0 *ledger.BlockAndPvtData
if rf, ok := ret.Get(0).(func(uint64) *ledger.BlockAndPvtData); ok {
r0 = rf(seqNum)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*ledger.BlockAndPvtData)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(uint64) error); ok {
r1 = rf(seqNum)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetPvtDataByNum provides a mock function with given fields: blockNum, filter
func (_m *Committer) GetPvtDataByNum(blockNum uint64, filter ledger.PvtNsCollFilter) ([]*ledger.TxPvtData, error) {
ret := _m.Called(blockNum, filter)
var r0 []*ledger.TxPvtData
if rf, ok := ret.Get(0).(func(uint64, ledger.PvtNsCollFilter) []*ledger.TxPvtData); ok {
r0 = rf(blockNum, filter)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*ledger.TxPvtData)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(uint64, ledger.PvtNsCollFilter) error); ok {
r1 = rf(blockNum, filter)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// LedgerHeight provides a mock function with given fields:
func (_m *Committer) LedgerHeight() (uint64, error) {
ret := _m.Called()
var r0 uint64
if rf, ok := ret.Get(0).(func() uint64); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(uint64)
}
var r1 error
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}