Skip to content

Commit

Permalink
mempool.NewMempool -> mempool.New (#2276)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhrubabasu authored Nov 8, 2023
1 parent 93d88c0 commit fc95834
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion vms/platformvm/block/builder/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion vms/platformvm/block/executor/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
2 changes: 1 addition & 1 deletion vms/platformvm/txs/mempool/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ type mempool struct {
blkTimer BlockTimer
}

func NewMempool(
func New(
namespace string,
registerer prometheus.Registerer,
blkTimer BlockTimer,
Expand Down
6 changes: 3 additions & 3 deletions vms/platformvm/txs/mempool/mempool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vms/platformvm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit fc95834

Please sign in to comment.