style(lint): fix lint issues

This commit is contained in:
hannahhoward 2020-11-04 21:31:09 -08:00
parent a3e93554e5
commit 09a0d6e607
6 changed files with 10 additions and 12 deletions

2
go.sum
View File

@ -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=

View File

@ -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 {

View File

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

View File

@ -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 {

View File

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

View File

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