Fixup manifest-cid-from-car
This commit is contained in:
parent
0c4863c58e
commit
bf6f9799e6
@ -1,11 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/blockstore"
|
"github.com/filecoin-project/lotus/blockstore"
|
||||||
@ -106,18 +104,8 @@ var cidFromCarCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
bs := blockstore.NewMemory()
|
bs := blockstore.NewMemory()
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
data, err := io.ReadAll(f)
|
hdr, err := car.LoadCar(ctx, bs, f)
|
||||||
if err != nil {
|
|
||||||
return xerrors.Errorf("error reading car file: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
blobr := bytes.NewReader(data)
|
|
||||||
|
|
||||||
hdr, err := car.LoadCar(ctx, bs, blobr)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error loading car file: %w", err)
|
return xerrors.Errorf("error loading car file: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user