@cryptotaxi247 / kubo / commits / 401b8f413

misc: move initialization sqaush

Brian Tiger Chow committed Jan 10, 2015 at 20:00 UTC 401b8f413d1dd04124eaf6bdf92c491e8efa4d79
1 file changed +7 -6
test/epictest/core.go
+7 -6
@@ -42,12 +42,6 @@ func makeCore(ctx context.Context, rf RepoFactory) (*Core, error) {
42 return nil, err
43 }
44
45 - node.Blocks, err = blockservice.New(node.Blockstore, node.Exchange)
46 - if err != nil {
47 - return nil, err
48 - }
49 -
50 - node.DAG = merkledag.NewDAGService(node.Blocks)
45 // to make sure nothing is omitted, init each individual field and assign
46 // all at once at the bottom.
47 return &Core{
@@ -111,12 +105,19 @@ func MocknetTestRepo(p peer.ID, h host.Host, conf testutil.LatencyConfig) RepoFa
105 return nil, err
106 }
107 exch := bitswap.New(ctx, p, bsn, bstore, alwaysSendToPeer)
108 + blockservice, err := blockservice.New(bstore, exch)
109 + if err != nil {
110 + return nil, err
111 + }
112 +
113 return &core.IpfsNode{
114 Peerstore: h.Peerstore(),
115 Blockstore: bstore,
116 Exchange: exch,
117 Datastore: ds,
118 PeerHost: h,
119 + DAG: merkledag.NewDAGService(blockservice),
120 + Blocks: blockservice,
121 Routing: dhtt,
122 Identity: p,
123 DHT: dhtt,