-
Notifications
You must be signed in to change notification settings - Fork 199
/
whiteListHandlerStub.go
46 lines (39 loc) · 1.12 KB
/
whiteListHandlerStub.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
package mock
import "github.com/ElrondNetwork/elrond-go/process"
// WhiteListHandlerStub -
type WhiteListHandlerStub struct {
RemoveCalled func(keys [][]byte)
AddCalled func(keys [][]byte)
IsWhiteListedCalled func(interceptedData process.InterceptedData) bool
IsForCurrentShardCalled func(interceptedData process.InterceptedData) bool
}
// IsWhiteListed -
func (w *WhiteListHandlerStub) IsWhiteListed(interceptedData process.InterceptedData) bool {
if w.IsWhiteListedCalled != nil {
return w.IsWhiteListedCalled(interceptedData)
}
return true
}
// IsForCurrentShard -
func (w *WhiteListHandlerStub) IsForCurrentShard(interceptedData process.InterceptedData) bool {
if w.IsForCurrentShardCalled != nil {
return w.IsForCurrentShardCalled(interceptedData)
}
return true
}
// Remove -
func (w *WhiteListHandlerStub) Remove(keys [][]byte) {
if w.RemoveCalled != nil {
w.RemoveCalled(keys)
}
}
// Add -
func (w *WhiteListHandlerStub) Add(keys [][]byte) {
if w.AddCalled != nil {
w.AddCalled(keys)
}
}
// IsInterfaceNil -
func (w *WhiteListHandlerStub) IsInterfaceNil() bool {
return w == nil
}