Skip to content

Commit

Permalink
fix: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsenta committed Mar 31, 2023
1 parent 3b1e717 commit fbd32ec
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions tooling/car/unixfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/ipfs/boxo/ipld/merkledag"
"github.com/ipfs/boxo/ipld/unixfs/io"
"github.com/ipfs/gateway-conformance/tooling/fixtures"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
format "github.com/ipfs/go-ipld-format"
"github.com/ipld/go-ipld-prime"
Expand Down Expand Up @@ -151,30 +150,4 @@ func MustOpenUnixfsCar(file string) *UnixfsDag {
os.Exit(1)
}
return dag
}

func newBlockFromCar(file string) (blocks.Block, error) {
bs, err := blockstore.OpenReadOnly(file)
if err != nil {
return nil, err
}
root, err := bs.Roots()
if err != nil {
return nil, err
}
if len(root) != 1 {
return nil, fmt.Errorf("expected 1 root, got %d", len(root))
}
return bs.Get(context.Background(), root[0])
}

func MustOpenRawBlockFromCar(file string) blocks.Block {
fixturePath := path.Join(fixtures.Dir(), file)

block, err := newBlockFromCar(fixturePath)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
return block
}
}

0 comments on commit fbd32ec

Please sign in to comment.