-
Notifications
You must be signed in to change notification settings - Fork 199
/
interceptorContainerStub.go
58 lines (47 loc) · 1.33 KB
/
interceptorContainerStub.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
package mock
import (
"github.com/ElrondNetwork/elrond-go/p2p"
"github.com/ElrondNetwork/elrond-go/process"
)
// InterceptorsContainerStub -
type InterceptorsContainerStub struct {
GetCalled func(string) (process.Interceptor, error)
}
// Iterate -
func (ics *InterceptorsContainerStub) Iterate(_ func(key string, interceptor process.Interceptor) bool) {
}
// Get -
func (ics *InterceptorsContainerStub) Get(topic string) (process.Interceptor, error) {
if ics.GetCalled != nil {
return ics.GetCalled(topic)
}
return &InterceptorStub{
ProcessReceivedMessageCalled: func(message p2p.MessageP2P) error {
return nil
},
}, nil
}
// Add -
func (ics *InterceptorsContainerStub) Add(_ string, _ process.Interceptor) error {
panic("implement me")
}
// AddMultiple -
func (ics *InterceptorsContainerStub) AddMultiple(_ []string, _ []process.Interceptor) error {
panic("implement me")
}
// Replace -
func (ics *InterceptorsContainerStub) Replace(_ string, _ process.Interceptor) error {
panic("implement me")
}
// Remove -
func (ics *InterceptorsContainerStub) Remove(_ string) {
panic("implement me")
}
// Len -
func (ics *InterceptorsContainerStub) Len() int {
panic("implement me")
}
// IsInterfaceNil returns true if there is no value under the interface
func (ics *InterceptorsContainerStub) IsInterfaceNil() bool {
return ics == nil
}