From fc95834bb2ef89faffc4f8de43eaec71aa80cad3 Mon Sep 17 00:00:00 2001 From: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:41:39 -0500 Subject: [PATCH] `mempool.NewMempool` -> `mempool.New` (#2276) --- vms/platformvm/block/builder/helpers_test.go | 2 +- vms/platformvm/block/executor/helpers_test.go | 2 +- vms/platformvm/txs/mempool/mempool.go | 2 +- vms/platformvm/txs/mempool/mempool_test.go | 6 +++--- vms/platformvm/vm.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vms/platformvm/block/builder/helpers_test.go b/vms/platformvm/block/builder/helpers_test.go index ed55791147d8..a773fc964ef6 100644 --- a/vms/platformvm/block/builder/helpers_test.go +++ b/vms/platformvm/block/builder/helpers_test.go @@ -157,7 +157,7 @@ func newEnvironment(t *testing.T) *environment { metrics, err := metrics.New("", registerer) require.NoError(err) - res.mempool, err = mempool.NewMempool("mempool", registerer, res) + res.mempool, err = mempool.New("mempool", registerer, res) require.NoError(err) res.blkManager = blockexecutor.NewManager( diff --git a/vms/platformvm/block/executor/helpers_test.go b/vms/platformvm/block/executor/helpers_test.go index 5e79d52c9b10..9448cdde44eb 100644 --- a/vms/platformvm/block/executor/helpers_test.go +++ b/vms/platformvm/block/executor/helpers_test.go @@ -189,7 +189,7 @@ func newEnvironment(t *testing.T, ctrl *gomock.Controller) *environment { metrics := metrics.Noop var err error - res.mempool, err = mempool.NewMempool("mempool", registerer, res) + res.mempool, err = mempool.New("mempool", registerer, res) if err != nil { panic(fmt.Errorf("failed to create mempool: %w", err)) } diff --git a/vms/platformvm/txs/mempool/mempool.go b/vms/platformvm/txs/mempool/mempool.go index 7d1ba9b609bd..086e29b7047c 100644 --- a/vms/platformvm/txs/mempool/mempool.go +++ b/vms/platformvm/txs/mempool/mempool.go @@ -97,7 +97,7 @@ type mempool struct { blkTimer BlockTimer } -func NewMempool( +func New( namespace string, registerer prometheus.Registerer, blkTimer BlockTimer, diff --git a/vms/platformvm/txs/mempool/mempool_test.go b/vms/platformvm/txs/mempool/mempool_test.go index bdcd3101233f..dbfe895f9d9b 100644 --- a/vms/platformvm/txs/mempool/mempool_test.go +++ b/vms/platformvm/txs/mempool/mempool_test.go @@ -34,7 +34,7 @@ func TestBlockBuilderMaxMempoolSizeHandling(t *testing.T) { require := require.New(t) registerer := prometheus.NewRegistry() - mpool, err := NewMempool("mempool", registerer, &noopBlkTimer{}) + mpool, err := New("mempool", registerer, &noopBlkTimer{}) require.NoError(err) decisionTxs, err := createTestDecisionTxs(1) @@ -58,7 +58,7 @@ func TestDecisionTxsInMempool(t *testing.T) { require := require.New(t) registerer := prometheus.NewRegistry() - mpool, err := NewMempool("mempool", registerer, &noopBlkTimer{}) + mpool, err := New("mempool", registerer, &noopBlkTimer{}) require.NoError(err) decisionTxs, err := createTestDecisionTxs(2) @@ -110,7 +110,7 @@ func TestProposalTxsInMempool(t *testing.T) { require := require.New(t) registerer := prometheus.NewRegistry() - mpool, err := NewMempool("mempool", registerer, &noopBlkTimer{}) + mpool, err := New("mempool", registerer, &noopBlkTimer{}) require.NoError(err) // The proposal txs are ordered by decreasing start time. This means after diff --git a/vms/platformvm/vm.go b/vms/platformvm/vm.go index 8522d3ae4715..72201c16e42f 100644 --- a/vms/platformvm/vm.go +++ b/vms/platformvm/vm.go @@ -177,7 +177,7 @@ func (vm *VM) Initialize( // Note: There is a circular dependency between the mempool and block // builder which is broken by passing in the vm. - mempool, err := mempool.NewMempool("mempool", registerer, vm) + mempool, err := mempool.New("mempool", registerer, vm) if err != nil { return fmt.Errorf("failed to create mempool: %w", err) }