-
Notifications
You must be signed in to change notification settings - Fork 105
/
types.go
224 lines (205 loc) · 6.71 KB
/
types.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
219
220
221
222
223
224
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package mock
import (
"github.com/axelarnetwork/axelar-core/x/snapshot/exported"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
"sync"
)
// Ensure, that ValidatorIMock does implement exported.ValidatorI.
// If this is not the case, regenerate this file with moq.
var _ exported.ValidatorI = &ValidatorIMock{}
// ValidatorIMock is a mock implementation of exported.ValidatorI.
//
// func TestSomethingThatUsesValidatorI(t *testing.T) {
//
// // make and configure a mocked exported.ValidatorI
// mockedValidatorI := &ValidatorIMock{
// GetConsAddrFunc: func() (github_com_cosmos_cosmos_sdk_types.ConsAddress, error) {
// panic("mock out the GetConsAddr method")
// },
// GetConsensusPowerFunc: func(intMoqParam github_com_cosmos_cosmos_sdk_types.Int) int64 {
// panic("mock out the GetConsensusPower method")
// },
// GetOperatorFunc: func() github_com_cosmos_cosmos_sdk_types.ValAddress {
// panic("mock out the GetOperator method")
// },
// IsBondedFunc: func() bool {
// panic("mock out the IsBonded method")
// },
// IsJailedFunc: func() bool {
// panic("mock out the IsJailed method")
// },
// }
//
// // use mockedValidatorI in code that requires exported.ValidatorI
// // and then make assertions.
//
// }
type ValidatorIMock struct {
// GetConsAddrFunc mocks the GetConsAddr method.
GetConsAddrFunc func() (github_com_cosmos_cosmos_sdk_types.ConsAddress, error)
// GetConsensusPowerFunc mocks the GetConsensusPower method.
GetConsensusPowerFunc func(intMoqParam github_com_cosmos_cosmos_sdk_types.Int) int64
// GetOperatorFunc mocks the GetOperator method.
GetOperatorFunc func() github_com_cosmos_cosmos_sdk_types.ValAddress
// IsBondedFunc mocks the IsBonded method.
IsBondedFunc func() bool
// IsJailedFunc mocks the IsJailed method.
IsJailedFunc func() bool
// calls tracks calls to the methods.
calls struct {
// GetConsAddr holds details about calls to the GetConsAddr method.
GetConsAddr []struct {
}
// GetConsensusPower holds details about calls to the GetConsensusPower method.
GetConsensusPower []struct {
// IntMoqParam is the intMoqParam argument value.
IntMoqParam github_com_cosmos_cosmos_sdk_types.Int
}
// GetOperator holds details about calls to the GetOperator method.
GetOperator []struct {
}
// IsBonded holds details about calls to the IsBonded method.
IsBonded []struct {
}
// IsJailed holds details about calls to the IsJailed method.
IsJailed []struct {
}
}
lockGetConsAddr sync.RWMutex
lockGetConsensusPower sync.RWMutex
lockGetOperator sync.RWMutex
lockIsBonded sync.RWMutex
lockIsJailed sync.RWMutex
}
// GetConsAddr calls GetConsAddrFunc.
func (mock *ValidatorIMock) GetConsAddr() (github_com_cosmos_cosmos_sdk_types.ConsAddress, error) {
if mock.GetConsAddrFunc == nil {
panic("ValidatorIMock.GetConsAddrFunc: method is nil but ValidatorI.GetConsAddr was just called")
}
callInfo := struct {
}{}
mock.lockGetConsAddr.Lock()
mock.calls.GetConsAddr = append(mock.calls.GetConsAddr, callInfo)
mock.lockGetConsAddr.Unlock()
return mock.GetConsAddrFunc()
}
// GetConsAddrCalls gets all the calls that were made to GetConsAddr.
// Check the length with:
//
// len(mockedValidatorI.GetConsAddrCalls())
func (mock *ValidatorIMock) GetConsAddrCalls() []struct {
} {
var calls []struct {
}
mock.lockGetConsAddr.RLock()
calls = mock.calls.GetConsAddr
mock.lockGetConsAddr.RUnlock()
return calls
}
// GetConsensusPower calls GetConsensusPowerFunc.
func (mock *ValidatorIMock) GetConsensusPower(intMoqParam github_com_cosmos_cosmos_sdk_types.Int) int64 {
if mock.GetConsensusPowerFunc == nil {
panic("ValidatorIMock.GetConsensusPowerFunc: method is nil but ValidatorI.GetConsensusPower was just called")
}
callInfo := struct {
IntMoqParam github_com_cosmos_cosmos_sdk_types.Int
}{
IntMoqParam: intMoqParam,
}
mock.lockGetConsensusPower.Lock()
mock.calls.GetConsensusPower = append(mock.calls.GetConsensusPower, callInfo)
mock.lockGetConsensusPower.Unlock()
return mock.GetConsensusPowerFunc(intMoqParam)
}
// GetConsensusPowerCalls gets all the calls that were made to GetConsensusPower.
// Check the length with:
//
// len(mockedValidatorI.GetConsensusPowerCalls())
func (mock *ValidatorIMock) GetConsensusPowerCalls() []struct {
IntMoqParam github_com_cosmos_cosmos_sdk_types.Int
} {
var calls []struct {
IntMoqParam github_com_cosmos_cosmos_sdk_types.Int
}
mock.lockGetConsensusPower.RLock()
calls = mock.calls.GetConsensusPower
mock.lockGetConsensusPower.RUnlock()
return calls
}
// GetOperator calls GetOperatorFunc.
func (mock *ValidatorIMock) GetOperator() github_com_cosmos_cosmos_sdk_types.ValAddress {
if mock.GetOperatorFunc == nil {
panic("ValidatorIMock.GetOperatorFunc: method is nil but ValidatorI.GetOperator was just called")
}
callInfo := struct {
}{}
mock.lockGetOperator.Lock()
mock.calls.GetOperator = append(mock.calls.GetOperator, callInfo)
mock.lockGetOperator.Unlock()
return mock.GetOperatorFunc()
}
// GetOperatorCalls gets all the calls that were made to GetOperator.
// Check the length with:
//
// len(mockedValidatorI.GetOperatorCalls())
func (mock *ValidatorIMock) GetOperatorCalls() []struct {
} {
var calls []struct {
}
mock.lockGetOperator.RLock()
calls = mock.calls.GetOperator
mock.lockGetOperator.RUnlock()
return calls
}
// IsBonded calls IsBondedFunc.
func (mock *ValidatorIMock) IsBonded() bool {
if mock.IsBondedFunc == nil {
panic("ValidatorIMock.IsBondedFunc: method is nil but ValidatorI.IsBonded was just called")
}
callInfo := struct {
}{}
mock.lockIsBonded.Lock()
mock.calls.IsBonded = append(mock.calls.IsBonded, callInfo)
mock.lockIsBonded.Unlock()
return mock.IsBondedFunc()
}
// IsBondedCalls gets all the calls that were made to IsBonded.
// Check the length with:
//
// len(mockedValidatorI.IsBondedCalls())
func (mock *ValidatorIMock) IsBondedCalls() []struct {
} {
var calls []struct {
}
mock.lockIsBonded.RLock()
calls = mock.calls.IsBonded
mock.lockIsBonded.RUnlock()
return calls
}
// IsJailed calls IsJailedFunc.
func (mock *ValidatorIMock) IsJailed() bool {
if mock.IsJailedFunc == nil {
panic("ValidatorIMock.IsJailedFunc: method is nil but ValidatorI.IsJailed was just called")
}
callInfo := struct {
}{}
mock.lockIsJailed.Lock()
mock.calls.IsJailed = append(mock.calls.IsJailed, callInfo)
mock.lockIsJailed.Unlock()
return mock.IsJailedFunc()
}
// IsJailedCalls gets all the calls that were made to IsJailed.
// Check the length with:
//
// len(mockedValidatorI.IsJailedCalls())
func (mock *ValidatorIMock) IsJailedCalls() []struct {
} {
var calls []struct {
}
mock.lockIsJailed.RLock()
calls = mock.calls.IsJailed
mock.lockIsJailed.RUnlock()
return calls
}