@@ -9,7 +9,7 @@ chai.use(require('dirty-chai'))
9
9
const expect = chai . expect
10
10
const mh = require ( 'multihashes' )
11
11
const BlockService = require ( 'ipfs-block-service' )
12
- const IPLDResolver = require ( 'ipld-resolver ' )
12
+ const Ipld = require ( 'ipld' )
13
13
const pull = require ( 'pull-stream' )
14
14
const pushable = require ( 'pull-pushable' )
15
15
const whilst = require ( 'async/whilst' )
@@ -20,11 +20,11 @@ module.exports = (repo) => {
20
20
describe ( 'builder: directory sharding' , function ( ) {
21
21
this . timeout ( 30 * 1000 )
22
22
23
- let ipldResolver
23
+ let ipld
24
24
25
25
before ( ( ) => {
26
26
const bs = new BlockService ( repo )
27
- ipldResolver = new IPLDResolver ( bs )
27
+ ipld = new Ipld ( bs )
28
28
} )
29
29
30
30
describe ( 'basic dirbuilder' , ( ) => {
@@ -42,7 +42,7 @@ module.exports = (repo) => {
42
42
content : pull . values ( [ Buffer . from ( 'i have the best bytes' ) ] )
43
43
}
44
44
] ) ,
45
- importer ( ipldResolver , options ) ,
45
+ importer ( ipld , options ) ,
46
46
pull . collect ( ( err , nodes ) => {
47
47
expect ( err ) . to . not . exist ( )
48
48
expect ( nodes . length ) . to . be . eql ( 2 )
@@ -67,7 +67,7 @@ module.exports = (repo) => {
67
67
content : pull . values ( [ Buffer . from ( 'i have the best bytes' ) ] )
68
68
}
69
69
] ) ,
70
- importer ( ipldResolver , options ) ,
70
+ importer ( ipld , options ) ,
71
71
pull . collect ( ( err , nodes ) => {
72
72
expect ( err ) . to . not . exist ( )
73
73
expect ( nodes . length ) . to . be . eql ( 2 )
@@ -83,7 +83,7 @@ module.exports = (repo) => {
83
83
84
84
it ( 'exporting unsharded hash results in the correct files' , ( done ) => {
85
85
pull (
86
- exporter ( nonShardedHash , ipldResolver ) ,
86
+ exporter ( nonShardedHash , ipld ) ,
87
87
pull . collect ( ( err , nodes ) => {
88
88
expect ( err ) . to . not . exist ( )
89
89
expect ( nodes . length ) . to . be . eql ( 2 )
@@ -109,7 +109,7 @@ module.exports = (repo) => {
109
109
110
110
it ( 'exporting sharded hash results in the correct files' , ( done ) => {
111
111
pull (
112
- exporter ( shardedHash , ipldResolver ) ,
112
+ exporter ( shardedHash , ipld ) ,
113
113
pull . collect ( ( err , nodes ) => {
114
114
expect ( err ) . to . not . exist ( )
115
115
expect ( nodes . length ) . to . be . eql ( 2 )
@@ -142,7 +142,7 @@ module.exports = (repo) => {
142
142
const push = pushable ( )
143
143
pull (
144
144
push ,
145
- importer ( ipldResolver ) ,
145
+ importer ( ipld ) ,
146
146
pull . collect ( ( err , nodes ) => {
147
147
expect ( err ) . to . not . exist ( )
148
148
expect ( nodes . length ) . to . be . eql ( maxDirs + 1 )
@@ -179,7 +179,7 @@ module.exports = (repo) => {
179
179
const contentEntries = [ ]
180
180
const entries = { }
181
181
pull (
182
- exporter ( rootHash , ipldResolver ) ,
182
+ exporter ( rootHash , ipld ) ,
183
183
pull . asyncMap ( ( node , callback ) => {
184
184
if ( node . content ) {
185
185
pull (
@@ -234,7 +234,7 @@ module.exports = (repo) => {
234
234
const push = pushable ( )
235
235
pull (
236
236
push ,
237
- importer ( ipldResolver ) ,
237
+ importer ( ipld ) ,
238
238
pull . collect ( ( err , nodes ) => {
239
239
expect ( err ) . to . not . exist ( )
240
240
const last = nodes [ nodes . length - 1 ]
@@ -281,7 +281,7 @@ module.exports = (repo) => {
281
281
it ( 'exports a big dir' , ( done ) => {
282
282
const entries = { }
283
283
pull (
284
- exporter ( rootHash , ipldResolver ) ,
284
+ exporter ( rootHash , ipld ) ,
285
285
pull . asyncMap ( ( node , callback ) => {
286
286
if ( node . content ) {
287
287
pull (
@@ -340,7 +340,7 @@ module.exports = (repo) => {
340
340
it ( 'exports a big dir with subpath' , ( done ) => {
341
341
const exportHash = mh . toB58String ( rootHash ) + '/big/big/2000'
342
342
pull (
343
- exporter ( exportHash , ipldResolver ) ,
343
+ exporter ( exportHash , ipld ) ,
344
344
pull . collect ( collected )
345
345
)
346
346
0 commit comments