-
Notifications
You must be signed in to change notification settings - Fork 199
/
shardCoordinatorMock.go
50 lines (40 loc) · 1018 Bytes
/
shardCoordinatorMock.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
package mock
import (
"github.com/ElrondNetwork/elrond-go-core/core"
)
// ShardCoordinatorMock -
type ShardCoordinatorMock struct {
SelfShardId uint32
}
// NumberOfShards -
func (scm *ShardCoordinatorMock) NumberOfShards() uint32 {
panic("implement me")
}
// ComputeId -
func (scm *ShardCoordinatorMock) ComputeId(_ []byte) uint32 {
return 0
}
// SetSelfShardId -
func (scm *ShardCoordinatorMock) SetSelfShardId(shardId uint32) error {
scm.SelfShardId = shardId
return nil
}
// SelfId -
func (scm *ShardCoordinatorMock) SelfId() uint32 {
return scm.SelfShardId
}
// SameShard -
func (scm *ShardCoordinatorMock) SameShard(_, _ []byte) bool {
return true
}
// CommunicationIdentifier -
func (scm *ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string {
if destShardID == core.MetachainShardId {
return "_0_META"
}
return "_0"
}
// IsInterfaceNil returns true if there is no value under the interface
func (scm *ShardCoordinatorMock) IsInterfaceNil() bool {
return scm == nil
}