diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index 586e71432..0ae7791d1 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -65,7 +65,7 @@ type MessagePool struct { curTsLk sync.RWMutex curTs *types.TipSet - api MpoolProvider + api Provider minGasPrice types.BigInt @@ -105,7 +105,7 @@ func (ms *msgSet) add(m *types.SignedMessage) error { return nil } -type MpoolProvider interface { +type Provider interface { SubscribeHeadChanges(func(rev, app []*types.TipSet) error) PutMessage(m store.ChainMsg) (cid.Cid, error) PubSubPublish(string, []byte) error @@ -119,7 +119,7 @@ type mpoolProvider struct { ps *pubsub.PubSub } -func NewMpoolProvider(sm *stmgr.StateManager, ps *pubsub.PubSub) MpoolProvider { +func NewProvider(sm *stmgr.StateManager, ps *pubsub.PubSub) Provider { return &mpoolProvider{sm, ps} } @@ -147,7 +147,7 @@ func (mpp *mpoolProvider) MessagesForTipset(ts *types.TipSet) ([]store.ChainMsg, return mpp.sm.ChainStore().MessagesForTipset(ts) } -func NewMessagePool(api MpoolProvider, ds dtypes.MetadataDS) (*MessagePool, error) { +func New(api Provider, ds dtypes.MetadataDS) (*MessagePool, error) { cache, _ := lru.New2Q(build.BlsSignatureCacheSize) mp := &MessagePool{ closer: make(chan struct{}), diff --git a/chain/messagepool/messagepool_test.go b/chain/messagepool/messagepool_test.go index d7c462d3e..1c42e5b18 100644 --- a/chain/messagepool/messagepool_test.go +++ b/chain/messagepool/messagepool_test.go @@ -115,7 +115,7 @@ func TestMessagePool(t *testing.T) { ds := datastore.NewMapDatastore() - mp, err := NewMessagePool(tma, ds) + mp, err := New(tma, ds) if err != nil { t.Fatal(err) } diff --git a/node/modules/chain.go b/node/modules/chain.go index 093573d76..728b4e7a1 100644 --- a/node/modules/chain.go +++ b/node/modules/chain.go @@ -43,8 +43,8 @@ func ChainExchange(mctx helpers.MetricsCtx, lc fx.Lifecycle, host host.Host, rt } func MessagePool(lc fx.Lifecycle, sm *stmgr.StateManager, ps *pubsub.PubSub, ds dtypes.MetadataDS) (*messagepool.MessagePool, error) { - mpp := messagepool.NewMpoolProvider(sm, ps) - mp, err := messagepool.NewMessagePool(mpp, ds) + mpp := messagepool.NewProvider(sm, ps) + mp, err := messagepool.New(mpp, ds) if err != nil { return nil, xerrors.Errorf("constructing mpool: %w", err) }