Skip to content

Commit

Permalink
util/testutil/addcat: importer.BuildDagFromReader -> unixfs.AddFromRe…
Browse files Browse the repository at this point in the history
…ader

The defaults used by the high-level wrapper are fine here, and we're
in a test so consuming shell/... is ok.
  • Loading branch information
wking committed May 1, 2015
1 parent 56807e9 commit 2409fee
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions util/testutil/addcat/addcat.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ import (

core "github.com/ipfs/go-ipfs/core"
coreunix "github.com/ipfs/go-ipfs/core/coreunix"
importer "github.com/ipfs/go-ipfs/importer"
chunk "github.com/ipfs/go-ipfs/importer/chunk"
unixfs "github.com/ipfs/go-ipfs/shell/unixfs"
errors "github.com/ipfs/go-ipfs/util/debugerror"
)

func AddCat(adder *core.IpfsNode, catter *core.IpfsNode, data string) error {
dagNode, err := importer.BuildDagFromReader(
strings.NewReader(data),
adder.DAG,
adder.Pinning.GetManual(),
chunk.DefaultSplitter)
dagNode, err := unixfs.AddFromReader(adder, strings.NewReader(data))
if err != nil {
return err
}
Expand Down

0 comments on commit 2409fee

Please sign in to comment.