-
Notifications
You must be signed in to change notification settings - Fork 175
/
committee.go
123 lines (100 loc) · 2.81 KB
/
committee.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
// Code generated by mockery v1.0.0. DO NOT EDIT.
package mocks
import (
hotstuff "github.com/onflow/flow-go/consensus/hotstuff"
flow "github.com/onflow/flow-go/model/flow"
mock "github.com/stretchr/testify/mock"
)
// Committee is an autogenerated mock type for the Committee type
type Committee struct {
mock.Mock
}
// DKG provides a mock function with given fields: blockID
func (_m *Committee) DKG(blockID flow.Identifier) (hotstuff.DKG, error) {
ret := _m.Called(blockID)
var r0 hotstuff.DKG
if rf, ok := ret.Get(0).(func(flow.Identifier) hotstuff.DKG); ok {
r0 = rf(blockID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(hotstuff.DKG)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
r1 = rf(blockID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Identities provides a mock function with given fields: blockID, selector
func (_m *Committee) Identities(blockID flow.Identifier, selector flow.IdentityFilter) (flow.IdentityList, error) {
ret := _m.Called(blockID, selector)
var r0 flow.IdentityList
if rf, ok := ret.Get(0).(func(flow.Identifier, flow.IdentityFilter) flow.IdentityList); ok {
r0 = rf(blockID, selector)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(flow.IdentityList)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(flow.Identifier, flow.IdentityFilter) error); ok {
r1 = rf(blockID, selector)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Identity provides a mock function with given fields: blockID, participantID
func (_m *Committee) Identity(blockID flow.Identifier, participantID flow.Identifier) (*flow.Identity, error) {
ret := _m.Called(blockID, participantID)
var r0 *flow.Identity
if rf, ok := ret.Get(0).(func(flow.Identifier, flow.Identifier) *flow.Identity); ok {
r0 = rf(blockID, participantID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*flow.Identity)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(flow.Identifier, flow.Identifier) error); ok {
r1 = rf(blockID, participantID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// LeaderForView provides a mock function with given fields: view
func (_m *Committee) LeaderForView(view uint64) (flow.Identifier, error) {
ret := _m.Called(view)
var r0 flow.Identifier
if rf, ok := ret.Get(0).(func(uint64) flow.Identifier); ok {
r0 = rf(view)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(flow.Identifier)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(uint64) error); ok {
r1 = rf(view)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Self provides a mock function with given fields:
func (_m *Committee) Self() flow.Identifier {
ret := _m.Called()
var r0 flow.Identifier
if rf, ok := ret.Get(0).(func() flow.Identifier); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(flow.Identifier)
}
}
return r0
}