Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove getter for router on chain manager #2641

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions chains/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ var (
type Manager interface {
ids.Aliaser

// Return the router this Manager is using to route consensus messages to chains
Router() router.Router

// Queues a chain to be created in the future after chain creator is unblocked.
// This is only called from the P-chain thread to create other chains
// Queued chains are created only after P-chain is bootstrapped.
Expand Down Expand Up @@ -289,11 +286,6 @@ func New(config *ManagerConfig) Manager {
}
}

// Router that this chain manager is using to route consensus messages to chains
func (m *manager) Router() router.Router {
return m.ManagerConfig.Router
}

// QueueChainCreation queues a chain creation request
// Invariant: Tracked Subnet must be checked before calling this function
func (m *manager) QueueChainCreation(chainParams ChainParameters) {
Expand Down
9 changes: 1 addition & 8 deletions chains/test_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@

package chains

import (
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow/networking/router"
)
import "github.com/ava-labs/avalanchego/ids"

// 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) {}
Expand Down
Loading