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

mempool.NewMempool -> mempool.New #2276

Merged
merged 1 commit into from
Nov 8, 2023
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
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
Loading