Skip to content

Commit

Permalink
finish addressing PR concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Oct 30, 2014
1 parent 2eafaa6 commit 8716912
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions unixfs/io/dagreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ func NewDagReader(n *mdag.Node, serv mdag.DAGService) (io.Reader, error) {
// Dont allow reading directories
return nil, ErrIsDir
case ftpb.Data_File:
dr := &DagReader{
return &DagReader{
node: n,
serv: serv,
buf: bytes.NewBuffer(pb.GetData()),
}
return dr, nil
}, nil
case ftpb.Data_Raw:
// Raw block will just be a single level, return a byte buffer
return bytes.NewBuffer(pb.GetData()), nil
Expand Down
6 changes: 4 additions & 2 deletions util/testutil/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
crand "crypto/rand"

"github.com/jbenet/go-ipfs/peer"
u "github.com/jbenet/go-ipfs/util"
)

func RandPeer() peer.Peer {
id := make(peer.ID, 16)
id := make([]byte, 16)
crand.Read(id)
return peer.WithID(id)
mhid := u.Hash(id)
return peer.WithID(peer.ID(mhid))
}

0 comments on commit 8716912

Please sign in to comment.