diff --git a/go.sum b/go.sum index 2e2fc387e..c949a71ea 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,6 @@ github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f h1 github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-markets v0.9.2-0.20201103030854-3d9aa08b3c2f h1:SAyL9YllpB/2gyclDE0AXQenEQc4O2g2IP+DDF7L0Vg= github.com/filecoin-project/go-fil-markets v0.9.2-0.20201103030854-3d9aa08b3c2f/go.mod h1:h+bJ/IUnYjnW5HMKyt9JQSnhslqetkpuzwwugc3K8vM= -github.com/filecoin-project/go-fil-markets v1.0.0 h1:np9+tlnWXh9xYG4oZfha6HZFLYOaAZoMGR3V4w6DM48= -github.com/filecoin-project/go-fil-markets v1.0.0/go.mod h1:lXExJyYHwpMMddCqhEdNrc7euYJKNkp04K76NZqJLGg= github.com/filecoin-project/go-hamt-ipld v0.1.5 h1:uoXrKbCQZ49OHpsTCkrThPNelC4W3LPEk0OrS/ytIBM= github.com/filecoin-project/go-hamt-ipld v0.1.5 h1:uoXrKbCQZ49OHpsTCkrThPNelC4W3LPEk0OrS/ytIBM= github.com/filecoin-project/go-hamt-ipld v0.1.5/go.mod h1:6Is+ONR5Cd5R6XZoCse1CWaXZc0Hdb/JeX+EQCQzX24= diff --git a/markets/storageadapter/client.go b/markets/storageadapter/client.go index 23a92c6d1..9d450c21b 100644 --- a/markets/storageadapter/client.go +++ b/markets/storageadapter/client.go @@ -213,7 +213,7 @@ func (c *ClientNodeAdapter) DealProviderCollateralBounds(ctx context.Context, si } func (c *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, publishCid *cid.Cid, cb storagemarket.DealSectorCommittedCallback) error { - return OnDealSectorCommitted(c, c.ev, ctx, provider, dealID, publishCid, cb) + return OnDealSectorCommitted(ctx, c, c.ev, provider, dealID, publishCid, cb) } func (c *ClientNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, onDealExpired storagemarket.DealExpiredCallback, onDealSlashed storagemarket.DealSlashedCallback) error { diff --git a/markets/storageadapter/getcurrentdealinfo_test.go b/markets/storageadapter/getcurrentdealinfo_test.go index f05ab52de..3bb117038 100644 --- a/markets/storageadapter/getcurrentdealinfo_test.go +++ b/markets/storageadapter/getcurrentdealinfo_test.go @@ -20,7 +20,7 @@ import ( "golang.org/x/xerrors" ) -var notFoundError = errors.New("Could not find") +var errNotFound = errors.New("Could not find") func TestGetCurrentDealInfo(t *testing.T) { ctx := context.Background() @@ -54,7 +54,7 @@ func TestGetCurrentDealInfo(t *testing.T) { }, "publish CID = nil": { expectedDealID: startDealID, - expectedError: notFoundError, + expectedError: errNotFound, }, "search message fails": { publishCid: &dummyCid, @@ -103,7 +103,7 @@ func TestGetCurrentDealInfo(t *testing.T) { }, }, expectedDealID: startDealID, - expectedError: notFoundError, + expectedError: errNotFound, }, "new deal id success": { publishCid: &dummyCid, @@ -128,7 +128,7 @@ func TestGetCurrentDealInfo(t *testing.T) { }, }, expectedDealID: newDealID, - expectedError: notFoundError, + expectedError: errNotFound, }, } for testCase, data := range testCases { @@ -174,7 +174,7 @@ type mockGetCurrentDealInfoAPI struct { func (mapi *mockGetCurrentDealInfoAPI) StateMarketStorageDeal(ctx context.Context, dealID abi.DealID, ts types.TipSetKey) (*api.MarketDeal, error) { deal, ok := mapi.MarketDeals[marketDealKey{dealID, ts}] if !ok { - return nil, notFoundError + return nil, errNotFound } return deal, nil } diff --git a/markets/storageadapter/ondealsectorcommitted.go b/markets/storageadapter/ondealsectorcommitted.go index 06f86ebbd..72569cf7e 100644 --- a/markets/storageadapter/ondealsectorcommitted.go +++ b/markets/storageadapter/ondealsectorcommitted.go @@ -19,7 +19,7 @@ type sectorCommittedEventsAPI interface { Called(check events.CheckFunc, msgHnd events.MsgHandler, rev events.RevertHandler, confidence int, timeout abi.ChainEpoch, mf events.MsgMatchFunc) error } -func OnDealSectorCommitted(api getCurrentDealInfoAPI, eventsApi sectorCommittedEventsAPI, ctx context.Context, provider address.Address, dealID abi.DealID, publishCid *cid.Cid, cb storagemarket.DealSectorCommittedCallback) error { +func OnDealSectorCommitted(ctx context.Context, api getCurrentDealInfoAPI, eventsApi sectorCommittedEventsAPI, provider address.Address, dealID abi.DealID, publishCid *cid.Cid, cb storagemarket.DealSectorCommittedCallback) error { checkFunc := func(ts *types.TipSet) (done bool, more bool, err error) { newDealID, sd, err := GetCurrentDealInfo(ctx, ts, api, dealID, publishCid) if err != nil { diff --git a/markets/storageadapter/ondealsectorcommitted_test.go b/markets/storageadapter/ondealsectorcommitted_test.go index b250a06ac..f2dafc137 100644 --- a/markets/storageadapter/ondealsectorcommitted_test.go +++ b/markets/storageadapter/ondealsectorcommitted_test.go @@ -263,7 +263,7 @@ func TestOnDealSectorCommitted(t *testing.T) { cbCallCount++ cbError = err } - err = OnDealSectorCommitted(api, eventsAPI, ctx, provider, startDealID, &publishCid, cb) + err = OnDealSectorCommitted(ctx, api, eventsAPI, provider, startDealID, &publishCid, cb) if data.expectedError == nil { require.NoError(t, err) } else { @@ -345,7 +345,7 @@ var seq int func generateCids(n int) []cid.Cid { cids := make([]cid.Cid, 0, n) for i := 0; i < n; i++ { - c := blocks.NewBlock([]byte(string(fmt.Sprint(seq)))).Cid() + c := blocks.NewBlock([]byte(fmt.Sprint(seq))).Cid() seq++ cids = append(cids, c) } diff --git a/markets/storageadapter/provider.go b/markets/storageadapter/provider.go index 03a1d9461..98a7d16ed 100644 --- a/markets/storageadapter/provider.go +++ b/markets/storageadapter/provider.go @@ -254,7 +254,7 @@ func (n *ProviderNodeAdapter) DealProviderCollateralBounds(ctx context.Context, } func (n *ProviderNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, publishCid *cid.Cid, cb storagemarket.DealSectorCommittedCallback) error { - return OnDealSectorCommitted(n, n.ev, ctx, provider, dealID, publishCid, cb) + return OnDealSectorCommitted(ctx, n, n.ev, provider, dealID, publishCid, cb) } func (n *ProviderNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error) {