-
Notifications
You must be signed in to change notification settings - Fork 199
/
interceptedMetaBlockMock.go
58 lines (47 loc) · 1.16 KB
/
interceptedMetaBlockMock.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/multiversx/mx-chain-core-go/data"
)
type interceptedMetaBlockMock struct {
HeaderHandlerToUse data.HeaderHandler
HashToUse []byte
}
// NewInterceptedMetaBlockMock -
func NewInterceptedMetaBlockMock(hdr data.HeaderHandler, hash []byte) *interceptedMetaBlockMock {
return &interceptedMetaBlockMock{
HeaderHandlerToUse: hdr,
HashToUse: hash,
}
}
// HeaderHandler -
func (i *interceptedMetaBlockMock) HeaderHandler() data.HeaderHandler {
return i.HeaderHandlerToUse
}
// CheckValidity -
func (i *interceptedMetaBlockMock) CheckValidity() error {
return nil
}
// IsForCurrentShard -
func (i *interceptedMetaBlockMock) IsForCurrentShard() bool {
return true
}
// Hash -
func (i *interceptedMetaBlockMock) Hash() []byte {
return i.HashToUse
}
// Type -
func (i *interceptedMetaBlockMock) Type() string {
return "type"
}
// String -
func (i *interceptedMetaBlockMock) String() string {
return "metaBlock"
}
// Identifiers -
func (i *interceptedMetaBlockMock) Identifiers() [][]byte {
return [][]byte{i.HashToUse}
}
// IsInterfaceNil -
func (i *interceptedMetaBlockMock) IsInterfaceNil() bool {
return i == nil
}