-
Notifications
You must be signed in to change notification settings - Fork 209
Expand file tree
/
Copy pathadapter.go
More file actions
107 lines (85 loc) · 2.81 KB
/
adapter.go
File metadata and controls
107 lines (85 loc) · 2.81 KB
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
// Code generated by mockery v2.21.4. DO NOT EDIT.
package mocknetwork
import (
flow "github.com/onflow/flow-go/model/flow"
channels "github.com/onflow/flow-go/network/channels"
mock "github.com/stretchr/testify/mock"
network "github.com/onflow/flow-go/network"
)
// Adapter is an autogenerated mock type for the Adapter type
type Adapter struct {
mock.Mock
}
// MulticastOnChannel provides a mock function with given fields: _a0, _a1, _a2, _a3
func (_m *Adapter) MulticastOnChannel(_a0 channels.Channel, _a1 interface{}, _a2 uint, _a3 ...flow.Identifier) error {
_va := make([]interface{}, len(_a3))
for _i := range _a3 {
_va[_i] = _a3[_i]
}
var _ca []interface{}
_ca = append(_ca, _a0, _a1, _a2)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 error
if rf, ok := ret.Get(0).(func(channels.Channel, interface{}, uint, ...flow.Identifier) error); ok {
r0 = rf(_a0, _a1, _a2, _a3...)
} else {
r0 = ret.Error(0)
}
return r0
}
// PublishOnChannel provides a mock function with given fields: _a0, _a1, _a2
func (_m *Adapter) PublishOnChannel(_a0 channels.Channel, _a1 interface{}, _a2 ...flow.Identifier) error {
_va := make([]interface{}, len(_a2))
for _i := range _a2 {
_va[_i] = _a2[_i]
}
var _ca []interface{}
_ca = append(_ca, _a0, _a1)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 error
if rf, ok := ret.Get(0).(func(channels.Channel, interface{}, ...flow.Identifier) error); ok {
r0 = rf(_a0, _a1, _a2...)
} else {
r0 = ret.Error(0)
}
return r0
}
// ReportMisbehaviorOnChannel provides a mock function with given fields: channel, report
func (_m *Adapter) ReportMisbehaviorOnChannel(channel channels.Channel, report network.MisbehaviorReport) {
_m.Called(channel, report)
}
// UnRegisterChannel provides a mock function with given fields: channel
func (_m *Adapter) UnRegisterChannel(channel channels.Channel) error {
ret := _m.Called(channel)
var r0 error
if rf, ok := ret.Get(0).(func(channels.Channel) error); ok {
r0 = rf(channel)
} else {
r0 = ret.Error(0)
}
return r0
}
// UnicastOnChannel provides a mock function with given fields: _a0, _a1, _a2
func (_m *Adapter) UnicastOnChannel(_a0 channels.Channel, _a1 interface{}, _a2 flow.Identifier) error {
ret := _m.Called(_a0, _a1, _a2)
var r0 error
if rf, ok := ret.Get(0).(func(channels.Channel, interface{}, flow.Identifier) error); ok {
r0 = rf(_a0, _a1, _a2)
} else {
r0 = ret.Error(0)
}
return r0
}
type mockConstructorTestingTNewAdapter interface {
mock.TestingT
Cleanup(func())
}
// NewAdapter creates a new instance of Adapter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewAdapter(t mockConstructorTestingTNewAdapter) *Adapter {
mock := &Adapter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}