Skip to content

Commit

Permalink
Merge pull request #532 from ipfs-force-community/chore/bump-v2.12.0-rc1
Browse files Browse the repository at this point in the history
chore: bump version to v2.12.0-rc1
  • Loading branch information
LinZexiao authored Jul 11, 2024
2 parents 8334b6e + 2519712 commit 59102cb
Show file tree
Hide file tree
Showing 11 changed files with 321 additions and 221 deletions.
6 changes: 3 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ func (a *API) ClientExportInto(ctx context.Context, exportRef types.ExportRef, c
retrievalBs = cbs
}

dserv := merkledag.NewDAGService(blockservice.New(retrievalBs, offline.Exchange(retrievalBs)))
dserv := merkledag.NewDAGService(blockservice.New(retrievalBs, offline.Exchange(retrievalBs))) //nolint:staticcheck

// Are we outputting a CAR?
if car {
Expand Down Expand Up @@ -1357,7 +1357,7 @@ func (a *API) ClientDealSize(ctx context.Context, root cid.Cid) (types.DataSize,
}
defer onDone()

dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs)))
dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs))) //nolint:staticcheck

var w lenWriter
err = car.WriteCar(ctx, dag, []cid.Cid{root}, &w)
Expand All @@ -1380,7 +1380,7 @@ func (a *API) ClientDealPieceCID(ctx context.Context, root cid.Cid) (types.DataC
}
defer onDone()

dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs)))
dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs))) //nolint:staticcheck
w := &writer.Writer{}
bw := bufio.NewWriterSize(w, int(writer.CommPBuf))

Expand Down
2 changes: 1 addition & 1 deletion client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestImportLocal(t *testing.T) {
_, err = car.LoadCar(ctx, bs, dr)
require.NoError(t, err)

dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs)))
dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs))) //nolint:staticcheck

nd, err := dag.Get(ctx, exportedRoots[0])
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion client/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func buildUnixFS(ctx context.Context, reader io.Reader, into bstore.Blockstore,
return cid.Undef, err
}

bsvc := blockservice.New(into, offline.Exchange(into))
bsvc := blockservice.New(into, offline.Exchange(into)) //nolint:staticcheck
dags := merkledag.NewDAGService(bsvc)
bufdag := ipld.NewBufferedDAG(ctx, dags)

Expand Down
4 changes: 2 additions & 2 deletions client/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestRoundtripUnixFS_Dense(t *testing.T) {
require.NoError(t, err)
defer readOnly.Close() //nolint:errcheck

dags := merkledag.NewDAGService(blockservice.New(readOnly, offline.Exchange(readOnly)))
dags := merkledag.NewDAGService(blockservice.New(readOnly, offline.Exchange(readOnly))) //nolint:staticcheck

nd, err := dags.Get(ctx, root)
require.NoError(t, err)
Expand Down Expand Up @@ -93,7 +93,7 @@ func TestRoundtripUnixFS_Filestore(t *testing.T) {
require.NoError(t, err)
defer fs.Close() //nolint:errcheck

dags := merkledag.NewDAGService(blockservice.New(fs, offline.Exchange(fs)))
dags := merkledag.NewDAGService(blockservice.New(fs, offline.Exchange(fs))) //nolint:staticcheck

nd, err := dags.Get(ctx, root)
require.NoError(t, err)
Expand Down
7 changes: 4 additions & 3 deletions cmd/droplet-client/storage_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,9 @@ var batchStorageDealInitV2 = &cli.Command{
m.pieceSize = paddedPieceSize.Unpadded()
}

dcap = big.NewInt(0).Sub(dcap, big.NewInt(int64(paddedPieceSize)).Int)
if dcap.Cmp(big.NewInt(0).Int) < 0 {
fmt.Printf("not enough datacap to create deal: %v\n", dcap)
remainDcap := big.NewInt(0).Sub(dcap, big.NewInt(int64(paddedPieceSize)).Int)
if remainDcap.Cmp(big.NewInt(0).Int) < 0 {
fmt.Printf("not enough datacap to create deal: %v\n", remainDcap)
break
}

Expand All @@ -517,6 +517,7 @@ var batchStorageDealInitV2 = &cli.Command{
continue
}
idx++
dcap = remainDcap
fmt.Println("created deal", dealUUID, ", piece cid", m.pieceCID)

_ = writer.Write([]string{dealUUID.String(), params.provider.String(), params.from.String(),
Expand Down
Loading

0 comments on commit 59102cb

Please sign in to comment.