Re: #1250: API methods should receive TipSetKeys, not TipSets, as input

This commit is contained in:
Aayush Rajasekaran
2020-02-17 19:53:43 -05:00
parent 4750f32ab6
commit 60970008c8
41 changed files with 451 additions and 292 deletions
+5 -1
View File
@@ -24,7 +24,11 @@ type MpoolAPI struct {
Mpool *messagepool.MessagePool
}
func (a *MpoolAPI) MpoolPending(ctx context.Context, ts *types.TipSet) ([]*types.SignedMessage, error) {
func (a *MpoolAPI) MpoolPending(ctx context.Context, tsk types.TipSetKey) ([]*types.SignedMessage, error) {
ts, err := a.Chain.GetTipSetFromKey(tsk)
if err != nil {
return nil, xerrors.Errorf("loading tipset %s: %w", tsk, err)
}
pending, mpts := a.Mpool.Pending()
haveCids := map[cid.Cid]struct{}{}