Merge pull request #8785 from filecoin-project/gstuart/fix/manifest-cid-bundle-cli

Fix: cli: clean up manifest-cid-from-car
This commit is contained in:
Łukasz Magiera 2022-06-02 10:32:50 +02:00 committed by GitHub
commit 93f3b49235
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,11 +1,9 @@
package main
import (
"bytes"
"encoding/base64"
"encoding/hex"
"fmt"
"io"
"os"
"github.com/filecoin-project/lotus/blockstore"
@ -106,18 +104,8 @@ var cidFromCarCmd = &cli.Command{
}
bs := blockstore.NewMemory()
if err != nil {
return err
}
data, err := io.ReadAll(f)
if err != nil {
return xerrors.Errorf("error reading car file: %w", err)
}
blobr := bytes.NewReader(data)
hdr, err := car.LoadCar(ctx, bs, blobr)
hdr, err := car.LoadCar(ctx, bs, f)
if err != nil {
return xerrors.Errorf("error loading car file: %w", err)
}