-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_reachabilitymanager.go
40 lines (30 loc) · 1.34 KB
/
test_reachabilitymanager.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
package reachabilitymanager
import (
"github.com/BTCGhostdag/BTCD/domain/consensus/model"
"github.com/BTCGhostdag/BTCD/domain/consensus/model/externalapi"
"github.com/BTCGhostdag/BTCD/domain/consensus/model/testapi"
)
type testReachabilityManager struct {
*reachabilityManager
}
func (t *testReachabilityManager) ReachabilityReindexSlack() uint64 {
return t.reachabilityManager.reindexSlack
}
func (t *testReachabilityManager) SetReachabilityReindexSlack(reindexSlack uint64) {
t.reachabilityManager.reindexSlack = reindexSlack
}
func (t *testReachabilityManager) SetReachabilityReindexWindow(reindexWindow uint64) {
t.reachabilityManager.reindexWindow = reindexWindow
}
func (t *testReachabilityManager) ValidateIntervals(root *externalapi.DomainHash) error {
stagingArea := model.NewStagingArea()
return t.reachabilityManager.validateIntervals(stagingArea, root)
}
func (t *testReachabilityManager) GetAllNodes(root *externalapi.DomainHash) ([]*externalapi.DomainHash, error) {
stagingArea := model.NewStagingArea()
return t.reachabilityManager.getAllNodes(stagingArea, root)
}
// NewTestReachabilityManager creates an instance of a TestReachabilityManager
func NewTestReachabilityManager(manager model.ReachabilityManager) testapi.TestReachabilityManager {
return &testReachabilityManager{reachabilityManager: manager.(*reachabilityManager)}
}