-
Notifications
You must be signed in to change notification settings - Fork 199
/
consensusCoreValidator.go
69 lines (66 loc) · 1.75 KB
/
consensusCoreValidator.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
package spos
import "github.com/ElrondNetwork/elrond-go-core/core/check"
// ValidateConsensusCore checks for nil all the container objects
func ValidateConsensusCore(container ConsensusCoreHandler) error {
if check.IfNil(container) {
return ErrNilConsensusCore
}
if check.IfNil(container.Blockchain()) {
return ErrNilBlockChain
}
if check.IfNil(container.BlockProcessor()) {
return ErrNilBlockProcessor
}
if check.IfNil(container.BootStrapper()) {
return ErrNilBootstrapper
}
if check.IfNil(container.BroadcastMessenger()) {
return ErrNilBroadcastMessenger
}
if check.IfNil(container.Chronology()) {
return ErrNilChronologyHandler
}
if check.IfNil(container.Hasher()) {
return ErrNilHasher
}
if check.IfNil(container.Marshalizer()) {
return ErrNilMarshalizer
}
if check.IfNil(container.MultiSigner()) {
return ErrNilMultiSigner
}
if check.IfNil(container.RoundHandler()) {
return ErrNilRoundHandler
}
if check.IfNil(container.ShardCoordinator()) {
return ErrNilShardCoordinator
}
if check.IfNil(container.SyncTimer()) {
return ErrNilSyncTimer
}
if check.IfNil(container.NodesCoordinator()) {
return ErrNilNodesCoordinator
}
if check.IfNil(container.PrivateKey()) {
return ErrNilBlsPrivateKey
}
if check.IfNil(container.SingleSigner()) {
return ErrNilBlsSingleSigner
}
if check.IfNil(container.GetAntiFloodHandler()) {
return ErrNilAntifloodHandler
}
if check.IfNil(container.PeerHonestyHandler()) {
return ErrNilPeerHonestyHandler
}
if check.IfNil(container.HeaderSigVerifier()) {
return ErrNilHeaderSigVerifier
}
if check.IfNil(container.FallbackHeaderValidator()) {
return ErrNilFallbackHeaderValidator
}
if check.IfNil(container.NodeRedundancyHandler()) {
return ErrNilNodeRedundancyHandler
}
return nil
}