-
Notifications
You must be signed in to change notification settings - Fork 671
/
mock_manager.go
44 lines (37 loc) · 1.51 KB
/
mock_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
// Copyright (C) 2019-2022, 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"
)
var _ Manager = MockManager{}
// MockManager implements Manager but does nothing. Always returns nil error.
// To be used only in tests
type MockManager struct{}
func (mm MockManager) Router() router.Router { return nil }
func (mm MockManager) CreateChain(ChainParameters) {}
func (mm MockManager) ForceCreateChain(ChainParameters) {}
func (mm MockManager) AddRegistrant(Registrant) {}
func (mm MockManager) Aliases(ids.ID) ([]string, error) { return nil, nil }
func (mm MockManager) PrimaryAlias(ids.ID) (string, error) { return "", nil }
func (mm MockManager) PrimaryAliasOrDefault(ids.ID) string { return "" }
func (mm MockManager) Alias(ids.ID, string) error { return nil }
func (mm MockManager) RemoveAliases(ids.ID) {}
func (mm MockManager) Shutdown() {}
func (mm MockManager) SubnetID(ids.ID) (ids.ID, error) { return ids.ID{}, nil }
func (mm MockManager) IsBootstrapped(ids.ID) bool { return false }
func (mm MockManager) Lookup(s string) (ids.ID, error) {
id, err := ids.FromString(s)
if err == nil {
return id, nil
}
return ids.ID{}, nil
}
func (mm MockManager) LookupVM(s string) (ids.ID, error) {
id, err := ids.FromString(s)
if err == nil {
return id, nil
}
return ids.ID{}, nil
}