Skip to content

Commit

Permalink
fixup! feat: fix get-dag and add version=1 option
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Oct 22, 2021
1 parent 7e59d53 commit 52a83cb
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions cmd/car/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
_ "github.com/ipld/go-ipld-prime/codec/json"
_ "github.com/ipld/go-ipld-prime/codec/raw"

blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
ipfsbs "github.com/ipfs/go-ipfs-blockstore"
"github.com/ipld/go-car"
Expand Down Expand Up @@ -173,7 +172,7 @@ func writeCarV1(rootCid cid.Cid, output string, bs *blockstore.ReadOnly, strict
if linkVisitOnlyOnce {
opts = append(opts, car.TraverseLinksOnlyOnce())
}
sc := car.NewSelectiveCar(context.Background(), &readStore{bs}, []car.Dag{{Root: rootCid, Selector: sel}}, opts...)
sc := car.NewSelectiveCar(context.Background(), bs, []car.Dag{{Root: rootCid, Selector: sel}}, opts...)
f, err := os.Create(output)
if err != nil {
return err
Expand All @@ -182,11 +181,3 @@ func writeCarV1(rootCid cid.Cid, output string, bs *blockstore.ReadOnly, strict

return sc.Write(f)
}

type readStore struct {
bs *blockstore.ReadOnly
}

func (rs *readStore) Get(c cid.Cid) (blocks.Block, error) {
return rs.bs.Get(c)
}

0 comments on commit 52a83cb

Please sign in to comment.