rename to avoid stuttering

This commit is contained in:
whyrusleeping 2019-12-02 11:39:50 -08:00
parent b58e7344e8
commit 68e25b36f1
3 changed files with 7 additions and 7 deletions

View File

@ -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{}),

View File

@ -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)
}

View File

@ -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)
}