@cryptotaxi247 / kubo / commits / 096b3232d

address PR comments; remove commented/dead code

License: MIT Signed-off-by: Zach Ramsay <zach.ramsay@gmail.com>

zramsay committed May 31, 2017 at 23:41 UTC 096b3232d5e66dd5cf3c629a0a3ce361d0c5be6f
27 files changed +22 -302
blocks/blockstore/blockstore.go
+2 -7
@@ -102,10 +102,6 @@ func NewBlockstore(d ds.Batching) Blockstore {
102 type blockstore struct {
103 datastore ds.Batching
104
105 - lk sync.RWMutex
106 - gcreq int32
107 - gcreqlk sync.Mutex
108 -
105 rehash bool
106 }
107
@@ -246,9 +242,8 @@ func NewGCLocker() GCLocker {
242 }
243
244 type gclocker struct {
249 - lk sync.RWMutex
250 - gcreq int32
251 - gcreqlk sync.Mutex
245 + lk sync.RWMutex
246 + gcreq int32
247 }
248
249 // Unlocker represents an object which can Unlock
cmd/ipfs/main.go
+1 -6
@@ -37,17 +37,12 @@ import (
37 // log is the command logger
38 var log = logging.Logger("cmd/ipfs")
39
40 -var (
41 - // errUnexpectedApiOutput = errors.New("api returned unexpected output")
42 - // errApiVersionMismatch = errors.New("api version mismatch")
43 - errRequestCanceled = errors.New("request canceled")
44 -)
40 +var errRequestCanceled = errors.New("request canceled")
41
42 const (
43 EnvEnableProfiling = "IPFS_PROF"
44 cpuProfile = "ipfs.cpuprof"
45 heapProfile = "ipfs.memprof"
50 - // errorFormat = "ERROR: %v\n\n"
46 )
47
48 type cmdInvocation struct {
commands/files/multipartfile.go
-1
@@ -10,7 +10,6 @@ import (
10
11 const (
12 multipartFormdataType = "multipart/form-data"
13 - // multipartMixedType = "multipart/mixed"
13
14 applicationDirectory = "application/x-directory"
15 applicationSymlink = "application/symlink"
commands/http/handler.go
+3 -6
@@ -47,12 +47,9 @@ const (
47 extraContentLengthHeader = "X-Content-Length"
48 uaHeader = "User-Agent"
49 contentTypeHeader = "Content-Type"
50 - // contentDispHeader = "Content-Disposition"
51 - // transferEncodingHeader = "Transfer-Encoding"
52 - applicationJson = "application/json"
53 - applicationOctetStream = "application/octet-stream"
54 - plainText = "text/plain"
55 - // originHeader = "origin"
50 + applicationJson = "application/json"
51 + applicationOctetStream = "application/octet-stream"
52 + plainText = "text/plain"
53 )
54
55 var AllowedExposedHeadersArr = []string{streamHeader, channelHeader, extraContentLengthHeader}
core/commands/files/files.go
-5
@@ -664,11 +664,6 @@ stat' on the file or any of its ancestors.
664 return
665 }
666
667 - var r io.Reader = input
668 - if countfound {
669 - r = io.LimitReader(r, int64(count))
670 - }
671 -
667 n, err := io.Copy(wfd, input)
668 if err != nil {
669 res.SetError(err, cmds.ErrNormal)
core/core.go
+1 -3
@@ -74,7 +74,6 @@ import (
74
75 const IpnsValidatorTag = "ipns"
76
77 -// const kSizeBlockstoreWriteCache = 100
77 const kReprovideFrequency = time.Hour * 12
78 const discoveryConnTimeout = time.Second * 30
79
@@ -84,8 +83,7 @@ type mode int
83
84 const (
85 // zero value is not a valid mode, must be explicitly set
87 - invalidMode mode = iota
88 - localMode
86 + localMode mode = iota
87 offlineMode
88 onlineMode
89 )
core/corerouting/core.go
+1 -6
@@ -18,12 +18,7 @@ import (
18 // default and 2) to avoid a circular dependency (it needs to be referenced in
19 // the core if it's going to be the default)
20
21 -var (
22 - // errHostMissing = errors.New("supernode routing client requires a Host component")
23 - // errIdentityMissing = errors.New("supernode routing server requires a peer ID identity")
24 - // errPeerstoreMissing = errors.New("supernode routing server requires a peerstore")
25 - errServersMissing = errors.New("supernode routing client requires at least 1 server peer")
26 -)
21 +var errServersMissing = errors.New("supernode routing client requires at least 1 server peer")
22
23 // SupernodeServer returns a configuration for a routing server that stores
24 // routing records to the provided datastore. Only routing records are store in
exchange/bitswap/bitswap.go
+2 -3
@@ -37,9 +37,8 @@ const (
37 // TODO: if a 'non-nice' strategy is implemented, consider increasing this value
38 maxProvidersPerRequest = 3
39 providerRequestTimeout = time.Second * 10
40 - // hasBlockTimeout = time.Second * 15
41 - provideTimeout = time.Second * 15
42 - sizeBatchRequestChan = 32
40 + provideTimeout = time.Second * 15
41 + sizeBatchRequestChan = 32
42 // kMaxPriority is the max priority as defined by the bitswap protocol
43 kMaxPriority = math.MaxInt32
44 )
exchange/bitswap/bitswap_test.go
+2 -2
@@ -601,14 +601,14 @@ func TestBitswapLedgerTwoWay(t *testing.T) {
601
602 ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
603 defer cancel()
604 - blk, err := instances[1].Exchange.GetBlock(ctx, blocks[0].Cid())
604 + _, err = instances[1].Exchange.GetBlock(ctx, blocks[0].Cid())
605 if err != nil {
606 t.Fatal(err)
607 }
608
609 ctx, cancel = context.WithTimeout(context.Background(), time.Second*5)
610 defer cancel()
611 - blk, err = instances[0].Exchange.GetBlock(ctx, blocks[1].Cid())
611 + blk, err := instances[0].Exchange.GetBlock(ctx, blocks[1].Cid())
612 if err != nil {
613 t.Fatal(err)
614 }
exchange/bitswap/decision/ledger.go
-3
@@ -27,9 +27,6 @@ type ledger struct {
27 // Accounting tracks bytes sent and recieved.
28 Accounting debtRatio
29
30 - // firstExchnage is the time of the first data exchange.
31 - firstExchange time.Time
32 -
30 // lastExchange is the time of the last data exchange.
31 lastExchange time.Time
32
exchange/bitswap/testutils.go
-2
@@ -88,8 +88,6 @@ func (i *Instance) SetBlockstoreLatency(t time.Duration) time.Duration {
88 // just a much better idea.
89 func Session(ctx context.Context, net tn.Network, p testutil.Identity) Instance {
90 bsdelay := delay.Fixed(0)
91 - // const bloomSize = 512
92 - // const writeCacheElems = 100
91
92 adapter := net.Adapter(p)
93 dstore := ds_sync.MutexWrap(datastore2.WithDelay(ds.NewMapDatastore(), bsdelay))
exchange/bitswap/wantmanager.go
-10
@@ -55,16 +55,6 @@ func NewWantManager(ctx context.Context, network bsnet.BitSwapNetwork) *WantMana
55 }
56 }
57
58 -/*type msgPair struct {
59 - to peer.ID
60 - msg bsmsg.BitSwapMessage
61 -}
62 -
63 -type cancellation struct {
64 - who peer.ID
65 - blk *cid.Cid
66 -}*/
67 -
58 type msgQueue struct {
59 p peer.ID
60
fuse/node/mount_unix.go
-5
@@ -7,7 +7,6 @@ import (
7 "errors"
8 "fmt"
9 "strings"
10 - "time"
10
11 core "github.com/ipfs/go-ipfs/core"
12 ipns "github.com/ipfs/go-ipfs/fuse/ipns"
@@ -18,10 +17,6 @@ import (
17
18 var log = logging.Logger("node")
19
21 -// amount of time to wait for mount errors
22 -// TODO is this non-deterministic?
23 -const mountTimeout = time.Second
24 -
20 // fuseNoDirectory used to check the returning fuse error
21 const fuseNoDirectory = "fusermount: failed to access mountpoint"
22
fuse/readonly/readonly_unix.go
-1
@@ -85,7 +85,6 @@ func (*Root) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
85 type Node struct {
86 Ipfs *core.IpfsNode
87 Nd *mdag.ProtoNode
88 - fd *uio.DagReader
88 cached *ftpb.Data
89 }
90
importer/balanced/balanced_test.go
-6
@@ -12,7 +12,6 @@ import (
12 h "github.com/ipfs/go-ipfs/importer/helpers"
13 dag "github.com/ipfs/go-ipfs/merkledag"
14 mdtest "github.com/ipfs/go-ipfs/merkledag/test"
15 - pin "github.com/ipfs/go-ipfs/pin"
15 uio "github.com/ipfs/go-ipfs/unixfs/io"
16
17 "context"
@@ -124,11 +123,6 @@ func dagrArrComp(t *testing.T, r io.Reader, should []byte) {
123 }
124 }
125
127 -type dagservAndPinner struct {
128 - ds dag.DAGService
129 - mp pin.Pinner
130 -}
131 -
126 func TestIndirectBlocks(t *testing.T) {
127 ds := mdtest.Mock()
128 dag, buf := getTestDag(t, ds, 1024*1024, 512)
importer/helpers/helpers.go
-2
@@ -5,7 +5,6 @@ import (
5 "fmt"
6 "os"
7
8 - chunk "github.com/ipfs/go-ipfs/importer/chunk"
8 dag "github.com/ipfs/go-ipfs/merkledag"
9 pi "github.com/ipfs/go-ipfs/thirdparty/posinfo"
10 ft "github.com/ipfs/go-ipfs/unixfs"
@@ -18,7 +17,6 @@ import (
17 var BlockSizeLimit = 1048576 // 1 MB
18
19 // rough estimates on expected sizes
21 -var roughDataBlockSize = chunk.DefaultBlockSize
20 var roughLinkBlockSize = 1 << 13 // 8KB
21 var roughLinkSize = 34 + 8 + 5 // sha256 multihash + size + no name + protobuf framing
22
importer/trickle/trickle_test.go
-34
@@ -13,7 +13,6 @@ import (
13 h "github.com/ipfs/go-ipfs/importer/helpers"
14 merkledag "github.com/ipfs/go-ipfs/merkledag"
15 mdtest "github.com/ipfs/go-ipfs/merkledag/test"
16 - pin "github.com/ipfs/go-ipfs/pin"
16 ft "github.com/ipfs/go-ipfs/unixfs"
17 uio "github.com/ipfs/go-ipfs/unixfs/io"
18
@@ -125,11 +124,6 @@ func arrComp(a, b []byte) error {
124 return nil
125 }
126
128 -type dagservAndPinner struct {
129 - ds merkledag.DAGService
130 - mp pin.Pinner
131 -}
132 -
127 func TestIndirectBlocks(t *testing.T) {
128 splitter := chunk.SizeSplitterGen(512)
129 nbytes := 1024 * 1024
@@ -565,31 +559,3 @@ func TestAppendSingleBytesToEmpty(t *testing.T) {
559 t.Fatal(err)
560 }
561 }
568 -
569 -func printDag(nd *merkledag.ProtoNode, ds merkledag.DAGService, indent int) {
570 - pbd, err := ft.FromBytes(nd.Data())
571 - if err != nil {
572 - panic(err)
573 - }
574 -
575 - for i := 0; i < indent; i++ {
576 - fmt.Print(" ")
577 - }
578 - fmt.Printf("{size = %d, type = %s, nc = %d", pbd.GetFilesize(), pbd.GetType().String(), len(pbd.GetBlocksizes()))
579 - if len(nd.Links()) > 0 {
580 - fmt.Println()
581 - }
582 - for _, lnk := range nd.Links() {
583 - child, err := lnk.GetNode(context.Background(), ds)
584 - if err != nil {
585 - panic(err)
586 - }
587 - printDag(child.(*merkledag.ProtoNode), ds, indent+1)
588 - }
589 - if len(nd.Links()) > 0 {
590 - for i := 0; i < indent; i++ {
591 - fmt.Print(" ")
592 - }
593 - }
594 - fmt.Println("}")
595 -}
namesys/publisher.go
+3 -14
@@ -160,17 +160,11 @@ func PutRecordToRouting(ctx context.Context, k ci.PrivKey, value path.Path, seqn
160 errs <- PublishPublicKey(ctx, r, namekey, k.GetPublic())
161 }()
162
163 - err = waitOnErrChan(ctx, errs)
164 - if err != nil {
165 - return err
166 - }
167 -
168 - err = waitOnErrChan(ctx, errs)
169 - if err != nil {
163 + if err := waitOnErrChan(ctx, errs); err != nil {
164 return err
165 }
166
173 - return nil
167 + return waitOnErrChan(ctx, errs)
168 }
169
170 func waitOnErrChan(ctx context.Context, errs chan error) error {
@@ -340,12 +334,7 @@ func InitializeKeyspace(ctx context.Context, ds dag.DAGService, pub Publisher, p
334 return err
335 }
336
343 - err = pub.Publish(ctx, key, path.FromCid(nodek))
344 - if err != nil {
345 - return err
346 - }
347 -
348 - return nil
337 + return pub.Publish(ctx, key, path.FromCid(nodek))
338 }
339
340 func IpnsKeysForID(id peer.ID) (name, ipns string) {
repo/config/supernode.go
-7
@@ -20,13 +20,6 @@ var DefaultSNRServers = []string{
20 "/ip4/178.62.61.185/tcp/4002/ipfs/QmVw6fGNqBixZE4bewRLT2VXX7fAHUHs8JyidDiJ1P7RUN",
21 }
22
23 -func initSNRConfig() (*SupernodeClientConfig, error) {
24 - // TODO perform validation
25 - return &SupernodeClientConfig{
26 - Servers: DefaultSNRServers,
27 - }, nil
28 -}
29 -
23 func (gcr *SupernodeClientConfig) ServerIPFSAddrs() ([]ipfsaddr.IPFSAddr, error) {
24 var addrs []ipfsaddr.IPFSAddr
25 for _, server := range gcr.Servers {
repo/fsrepo/defaultds.go
-10
@@ -41,16 +41,6 @@ func openDefaultDatastore(r *FSRepo) (repo.Datastore, error) {
41 return nil, fmt.Errorf("unable to open flatfs datastore: %v", err)
42 }
43
44 - // Add our PeerID to metrics paths to keep them unique
45 - //
46 - // As some tests just pass a zero-value Config to fsrepo.Init,
47 - // cope with missing PeerID.
48 - id := r.config.Identity.PeerID
49 - if id == "" {
50 - // the tests pass in a zero Config; cope with it
51 - id = fmt.Sprintf("uninitialized_%p", r)
52 - }
53 -
44 prefix := "ipfs.fsrepo.datastore."
45 metricsBlocks := measure.New(prefix+"blocks", blocksDS)
46 metricsLevelDB := measure.New(prefix+"leveldb", leveldbDS)
repo/fsrepo/fsrepo.go
-6
@@ -37,12 +37,6 @@ var RepoVersion = 5
37 var migrationInstructions = `See https://github.com/ipfs/fs-repo-migrations/blob/master/run.md
38 Sorry for the inconvenience. In the future, these will run automatically.`
39
40 -/*
41 -var errIncorrectRepoFmt = `Repo has incorrect version: %s
42 -Program version is: %s
43 -Please run the ipfs migration tool before continuing.
44 -` + migrationInstructions
45 -*/
40 var programTooLowMessage = `Your programs version (%d) is lower than your repos (%d).
41 Please update ipfs to a version that supports the existing repo, or run
42 a migration in reverse.
routing/offline/offline_test.go
+1 -1
@@ -27,7 +27,7 @@ func TestOfflineRouterStorage(t *testing.T) {
27 t.Fatal("OfflineRouter does not properly store")
28 }
29
30 - val, err = offline.GetValue(ctx, "notHere")
30 + _, err = offline.GetValue(ctx, "notHere")
31 if err == nil {
32 t.Fatal("Router should throw errors for unfound records")
33 }
test/integration/three_legged_cat_test.go
-1
@@ -65,7 +65,6 @@ func TestThreeLeggedCat100MBMacbookCoastToCoast(t *testing.T) {
65 func RunThreeLeggedCat(data []byte, conf testutil.LatencyConfig) error {
66 ctx, cancel := context.WithCancel(context.Background())
67 defer cancel()
68 - // const numPeers = 3
68
69 // create network
70 mn := mocknet.New(ctx)
test/supernode_client/main.go
+2 -22
@@ -64,8 +64,8 @@ func run() error {
64 return err
65 }
66 repoPath := gopath.Join(cwd, config.DefaultPathName)
67 - if err := ensureRepoInitialized(repoPath); err != nil {
68 - }
67 + _ = ensureRepoInitialized(repoPath)
68 +
69 repo, err := fsrepo.Open(repoPath)
70 if err != nil { // owned by node
71 return err
@@ -233,26 +233,6 @@ func runFileCattingWorker(ctx context.Context, n *core.IpfsNode) error {
233 return nil
234 }
235
236 -func toPeerInfos(bpeers []config.BootstrapPeer) ([]pstore.PeerInfo, error) {
237 - var peers []pstore.PeerInfo
238 - for _, bootstrap := range bpeers {
239 - p, err := toPeerInfo(bootstrap)
240 - if err != nil {
241 - return nil, err
242 - }
243 - peers = append(peers, p)
244 - }
245 - return peers, nil
246 -}
247 -
248 -func toPeerInfo(bootstrap config.BootstrapPeer) (p pstore.PeerInfo, err error) {
249 - p = pstore.PeerInfo{
250 - ID: bootstrap.ID(),
251 - Addrs: []ma.Multiaddr{bootstrap.Multiaddr()},
252 - }
253 - return p, nil
254 -}
255 -
236 func cmdCtx(node *core.IpfsNode, repoPath string) commands.Context {
237 return commands.Context{
238 Online: true,
unixfs/hamt/hamt_stress_test.go
-104
@@ -1,13 +1,10 @@
1 package hamt
2
3 import (
4 - "bufio"
4 "context"
5 "fmt"
6 "math/rand"
7 "os"
9 - "strconv"
10 - "strings"
8 "testing"
9 "time"
10
@@ -189,104 +186,3 @@ func genOpSet(seed int64, keep, temp []string) []testOp {
186 }
187 }
188 }
192 -
193 -// executes the given op set with a repl to allow easier debugging
194 -func debugExecuteOpSet(ds dag.DAGService, width int, ops []testOp) (*HamtShard, error) {
195 - s, err := NewHamtShard(ds, width)
196 - if err != nil {
197 - return nil, err
198 - }
199 -
200 - e := ft.EmptyDirNode()
201 - ds.Add(e)
202 - ctx := context.TODO()
203 -
204 - run := 0
205 -
206 - opnames := map[int]string{
207 - opAdd: "add",
208 - opDel: "del",
209 - }
210 -
211 -mainloop:
212 - for i := 0; i < len(ops); i++ {
213 - o := ops[i]
214 -
215 - fmt.Printf("Op %d: %s %s\n", i, opnames[o.Op], o.Val)
216 - for run == 0 {
217 - cmd := readCommand()
218 - parts := strings.Split(cmd, " ")
219 - switch parts[0] {
220 - case "":
221 - run = 1
222 - case "find":
223 - _, err := s.Find(ctx, parts[1])
224 - if err == nil {
225 - fmt.Println("success")
226 - } else {
227 - fmt.Println(err)
228 - }
229 - case "run":
230 - if len(parts) > 1 {
231 - n, err := strconv.Atoi(parts[1])
232 - if err != nil {
233 - panic(err)
234 - }
235 -
236 - run = n
237 - } else {
238 - run = -1
239 - }
240 - case "lookop":
241 - for k := 0; k < len(ops); k++ {
242 - if ops[k].Val == parts[1] {
243 - fmt.Printf(" Op %d: %s %s\n", k, opnames[ops[k].Op], parts[1])
244 - }
245 - }
246 - case "restart":
247 - var err error
248 - s, err = NewHamtShard(ds, width)
249 - if err != nil {
250 - panic(err)
251 - }
252 - i = -1
253 - continue mainloop
254 - case "print":
255 - nd, err := s.Node()
256 - if err != nil {
257 - panic(err)
258 - }
259 - printDag(ds, nd.(*dag.ProtoNode), 0)
260 - }
261 - }
262 - run--
263 -
264 - switch o.Op {
265 - case opAdd:
266 - err := s.Set(ctx, o.Val, e)
267 - if err != nil {
268 - return nil, fmt.Errorf("inserting %s: %s", o.Val, err)
269 - }
270 - case opDel:
271 - fmt.Println("deleting: ", o.Val)
272 - err := s.Remove(ctx, o.Val)
273 - if err != nil {
274 - return nil, fmt.Errorf("deleting %s: %s", o.Val, err)
275 - }
276 - case opFind:
277 - _, err := s.Find(ctx, o.Val)
278 - if err != nil {
279 - return nil, fmt.Errorf("finding %s: %s", o.Val, err)
280 - }
281 - }
282 - }
283 -
284 - return s, nil
285 -}
286 -
287 -func readCommand() string {
288 - fmt.Print("> ")
289 - scan := bufio.NewScanner(os.Stdin)
290 - scan.Scan()
291 - return scan.Text()
292 -}
unixfs/hamt/hamt_test.go
+2 -18
@@ -6,7 +6,6 @@ import (
6 "math/rand"
7 "os"
8 "sort"
9 - "strings"
9 "testing"
10 "time"
11
@@ -138,7 +137,7 @@ func TestBasicSet(t *testing.T) {
137
138 func TestDirBuilding(t *testing.T) {
139 ds := mdtest.Mock()
141 - s, _ := NewHamtShard(ds, 256)
140 + _, _ = NewHamtShard(ds, 256)
141
142 _, s, err := makeDir(ds, 200)
143 if err != nil {
@@ -161,7 +160,7 @@ func TestDirBuilding(t *testing.T) {
160
161 func TestShardReload(t *testing.T) {
162 ds := mdtest.Mock()
164 - s, _ := NewHamtShard(ds, 256)
163 + _, _ = NewHamtShard(ds, 256)
164 ctx, cancel := context.WithCancel(context.Background())
165 defer cancel()
166
@@ -494,21 +493,6 @@ func TestSetHamtChild(t *testing.T) {
493 }
494 }
495
497 -func printDag(ds dag.DAGService, nd *dag.ProtoNode, depth int) {
498 - padding := strings.Repeat(" ", depth)
499 - fmt.Println("{")
500 - for _, l := range nd.Links() {
501 - fmt.Printf("%s%s: %s", padding, l.Name, l.Cid.String())
502 - ch, err := ds.Get(context.Background(), l.Cid)
503 - if err != nil {
504 - panic(err)
505 - }
506 -
507 - printDag(ds, ch.(*dag.ProtoNode), depth+1)
508 - }
509 - fmt.Println(padding + "}")
510 -}
511 -
496 func printDiff(ds dag.DAGService, a, b *dag.ProtoNode) {
497 diff, err := dagutils.Diff(context.TODO(), ds, a, b)
498 if err != nil {
unixfs/mod/dagmodifier_test.go
+2 -17
@@ -1,36 +1,21 @@
1 package mod
2
3 import (
4 + "context"
5 "fmt"
6 "io"
7 "io/ioutil"
8 "testing"
9
9 - "github.com/ipfs/go-ipfs/blocks/blockstore"
10 - bs "github.com/ipfs/go-ipfs/blockservice"
11 - "github.com/ipfs/go-ipfs/exchange/offline"
10 h "github.com/ipfs/go-ipfs/importer/helpers"
11 trickle "github.com/ipfs/go-ipfs/importer/trickle"
14 - mdag "github.com/ipfs/go-ipfs/merkledag"
12 ft "github.com/ipfs/go-ipfs/unixfs"
13 uio "github.com/ipfs/go-ipfs/unixfs/io"
14 testu "github.com/ipfs/go-ipfs/unixfs/test"
15
19 - context "context"
20 - ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore"
21 - "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/sync"
16 u "gx/ipfs/QmWbjfz3u6HkAdPh34dgPchGbQjob6LXLhAeCGii2TX69n/go-ipfs-util"
17 )
18
25 -func getMockDagServAndBstore(t testing.TB) (mdag.DAGService, blockstore.Blockstore) {
26 - dstore := ds.NewMapDatastore()
27 - tsds := sync.MutexWrap(dstore)
28 - bstore := blockstore.NewBlockstore(tsds)
29 - bserv := bs.New(bstore, offline.Exchange(bstore))
30 - dserv := mdag.NewDAGService(bserv)
31 - return dserv, bstore
32 -}
33 -
19 func testModWrite(t *testing.T, beg, size uint64, orig []byte, dm *DagModifier) []byte {
20 newdata := make([]byte, size)
21 r := u.NewTimeSeededRand()
@@ -112,7 +97,7 @@ func TestDagModifierBasic(t *testing.T) {
97 beg = uint64(len(b))
98 length = 3000
99 t.Log("Testing pure append")
115 - b = testModWrite(t, beg, length, b, dagmod)
100 + _ = testModWrite(t, beg, length, b, dagmod)
101
102 // Verify reported length
103 node, err := dagmod.GetNode()