-
Notifications
You must be signed in to change notification settings - Fork 725
/
Copy pathtest_manager.go
65 lines (46 loc) · 1.36 KB
/
test_manager.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
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package chains
import (
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow/networking/router"
)
// TestManager implements Manager but does nothing. Always returns nil error.
// To be used only in tests
var TestManager Manager = testManager{}
type testManager struct{}
func (testManager) Router() router.Router {
return nil
}
func (testManager) QueueChainCreation(ChainParameters) {}
func (testManager) ForceCreateChain(ChainParameters) {}
func (testManager) AddRegistrant(Registrant) {}
func (testManager) Aliases(ids.ID) ([]string, error) {
return nil, nil
}
func (testManager) PrimaryAlias(ids.ID) (string, error) {
return "", nil
}
func (testManager) PrimaryAliasOrDefault(ids.ID) string {
return ""
}
func (testManager) Alias(ids.ID, string) error {
return nil
}
func (testManager) RemoveAliases(ids.ID) {}
func (testManager) Shutdown() {}
func (testManager) StartChainCreator(ChainParameters) error {
return nil
}
func (testManager) SubnetID(ids.ID) (ids.ID, error) {
return ids.ID{}, nil
}
func (testManager) IsBootstrapped(ids.ID) bool {
return false
}
func (testManager) Lookup(s string) (ids.ID, error) {
return ids.FromString(s)
}
func (testManager) LookupVM(s string) (ids.ID, error) {
return ids.FromString(s)
}