Skip to content

Commit

Permalink
Remove getter for router on chain manager (#2641)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
  • Loading branch information
joshua-kim committed Jan 22, 2024
1 parent 7cea467 commit 1d5026d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
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

0 comments on commit 1d5026d

Please sign in to comment.