/
interceptedDataStub.go
70 lines (56 loc) · 1.29 KB
/
interceptedDataStub.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
package testscommon
// InterceptedDataStub -
type InterceptedDataStub struct {
CheckValidityCalled func() error
IsForCurrentShardCalled func() bool
HashCalled func() []byte
TypeCalled func() string
IdentifiersCalled func() [][]byte
StringCalled func() string
}
// CheckValidity -
func (ids *InterceptedDataStub) CheckValidity() error {
if ids.CheckValidityCalled != nil {
return ids.CheckValidityCalled()
}
return nil
}
// IsForCurrentShard -
func (ids *InterceptedDataStub) IsForCurrentShard() bool {
if ids.IsForCurrentShardCalled != nil {
return ids.IsForCurrentShardCalled()
}
return false
}
// IsInterfaceNil -
func (ids *InterceptedDataStub) IsInterfaceNil() bool {
return ids == nil
}
// Hash -
func (ids *InterceptedDataStub) Hash() []byte {
if ids.HashCalled != nil {
return ids.HashCalled()
}
return nil
}
// Type -
func (ids *InterceptedDataStub) Type() string {
if ids.TypeCalled != nil {
return ids.TypeCalled()
}
return ""
}
// Identifiers -
func (ids *InterceptedDataStub) Identifiers() [][]byte {
if ids.IdentifiersCalled != nil {
return ids.IdentifiersCalled()
}
return nil
}
// String -
func (ids *InterceptedDataStub) String() string {
if ids.StringCalled != nil {
return ids.StringCalled()
}
return ""
}