diff --git a/snow/engine/avalanche/bootstrapper_test.go b/snow/engine/avalanche/bootstrapper_test.go index c89926e..e0a9d56 100644 --- a/snow/engine/avalanche/bootstrapper_test.go +++ b/snow/engine/avalanche/bootstrapper_test.go @@ -58,7 +58,13 @@ func newConfig(t *testing.T) (BootstrapConfig, ids.ShortID, *common.SenderTest, peerID := peer.ID() peers.Add(peer) - handler.Initialize(engine, make(chan common.Message), 1) + handler.Initialize( + engine, + make(chan common.Message), + 1, + "", + prometheus.NewRegistry(), + ) timeouts.Initialize(0) router.Initialize(ctx.Log, timeouts, time.Hour, time.Second) diff --git a/snow/engine/avalanche/vertex_heap.go b/snow/engine/avalanche/vertex_heap.go index 59fff2e..7c68294 100644 --- a/snow/engine/avalanche/vertex_heap.go +++ b/snow/engine/avalanche/vertex_heap.go @@ -72,7 +72,7 @@ type maxHeightVertexHeap struct { elementIDs ids.Set } -func NewMaxVertexHeap() *maxHeightVertexHeap { +func newMaxVertexHeap() *maxHeightVertexHeap { return &maxHeightVertexHeap{ heap: &priorityQueue{}, elementIDs: ids.Set{}, diff --git a/snow/engine/avalanche/vertex_heap_test.go b/snow/engine/avalanche/vertex_heap_test.go index 5f27a18..f8ea16f 100644 --- a/snow/engine/avalanche/vertex_heap_test.go +++ b/snow/engine/avalanche/vertex_heap_test.go @@ -10,7 +10,7 @@ import ( // This example inserts several ints into an IntHeap, checks the minimum, // and removes them in order of priority. func TestUniqueVertexHeapReturnsOrdered(t *testing.T) { - h := NewMaxVertexHeap() + h := newMaxVertexHeap() vtx0 := &Vtx{ id: GenerateID(), @@ -90,7 +90,7 @@ func TestUniqueVertexHeapReturnsOrdered(t *testing.T) { } func TestUniqueVertexHeapRemainsUnique(t *testing.T) { - h := NewMaxVertexHeap() + h := newMaxVertexHeap() vtx0 := &Vtx{ height: 0, diff --git a/snow/engine/avalanche/voter.go b/snow/engine/avalanche/voter.go index f97992a..cb613d0 100644 --- a/snow/engine/avalanche/voter.go +++ b/snow/engine/avalanche/voter.go @@ -69,7 +69,7 @@ func (v *voter) Update() { func (v *voter) bubbleVotes(votes ids.UniqueBag) ids.UniqueBag { bubbledVotes := ids.UniqueBag{} - vertexHeap := NewMaxVertexHeap() + vertexHeap := newMaxVertexHeap() for _, vote := range votes.List() { vtx, err := v.t.Config.State.GetVertex(vote) if err != nil { diff --git a/snow/engine/snowman/bootstrapper_test.go b/snow/engine/snowman/bootstrapper_test.go index 3576f88..2e39da6 100644 --- a/snow/engine/snowman/bootstrapper_test.go +++ b/snow/engine/snowman/bootstrapper_test.go @@ -52,7 +52,13 @@ func newConfig(t *testing.T) (BootstrapConfig, ids.ShortID, *common.SenderTest, peerID := peer.ID() peers.Add(peer) - handler.Initialize(engine, make(chan common.Message), 1) + handler.Initialize( + engine, + make(chan common.Message), + 1, + "", + prometheus.NewRegistry(), + ) timeouts.Initialize(0) router.Initialize(ctx.Log, timeouts, time.Hour, time.Second) diff --git a/snow/networking/sender/sender_test.go b/snow/networking/sender/sender_test.go index 45286fa..7760307 100644 --- a/snow/networking/sender/sender_test.go +++ b/snow/networking/sender/sender_test.go @@ -15,6 +15,7 @@ import ( "github.com/ava-labs/gecko/snow/networking/router" "github.com/ava-labs/gecko/snow/networking/timeout" "github.com/ava-labs/gecko/utils/logging" + "github.com/prometheus/client_golang/prometheus" ) func TestSenderContext(t *testing.T) { @@ -58,7 +59,13 @@ func TestTimeout(t *testing.T) { } handler := router.Handler{} - handler.Initialize(&engine, nil, 1) + handler.Initialize( + &engine, + nil, + 1, + "", + prometheus.NewRegistry(), + ) go handler.Dispatch() chainRouter.AddChain(&handler) diff --git a/vms/platformvm/vm_test.go b/vms/platformvm/vm_test.go index fd782f7..8532559 100644 --- a/vms/platformvm/vm_test.go +++ b/vms/platformvm/vm_test.go @@ -1597,7 +1597,13 @@ func TestBootstrapPartiallyAccepted(t *testing.T) { // Asynchronously passes messages from the network to the consensus engine handler := &router.Handler{} - handler.Initialize(&engine, msgChan, 1000) + handler.Initialize( + &engine, + msgChan, + 1000, + "", + prometheus.NewRegistry(), + ) // Allow incoming messages to be routed to the new chain chainRouter.AddChain(handler) diff --git a/vms/spchainvm/consensus_benchmark_test.go b/vms/spchainvm/consensus_benchmark_test.go index 5dcc247..ed96adf 100644 --- a/vms/spchainvm/consensus_benchmark_test.go +++ b/vms/spchainvm/consensus_benchmark_test.go @@ -105,7 +105,13 @@ func ConsensusLeader(numBlocks, numTxsPerBlock int, b *testing.B) { // Asynchronously passes messages from the network to the consensus engine handler := &router.Handler{} - handler.Initialize(&engine, msgChan, 1000) + handler.Initialize( + &engine, + msgChan, + 1000, + "", + prometheus.NewRegistry(), + ) // Allow incoming messages to be routed to the new chain chainRouter.AddChain(handler) @@ -238,7 +244,13 @@ func ConsensusFollower(numBlocks, numTxsPerBlock int, b *testing.B) { // Asynchronously passes messages from the network to the consensus engine handler := &router.Handler{} - handler.Initialize(&engine, msgChan, 1000) + handler.Initialize( + &engine, + msgChan, + 1000, + "", + prometheus.NewRegistry(), + ) // Allow incoming messages to be routed to the new chain chainRouter.AddChain(handler)