@@ -10,8 +10,8 @@ import { MemoryDatastore } from 'datastore-core'
10
10
import { fixedSize } from 'ipfs-unixfs-importer/chunker'
11
11
import toBuffer from 'it-to-buffer'
12
12
import { car , type Car } from '../src/index.js'
13
- import { dagWalkers } from './fixtures/dag-walkers.js'
14
13
import { largeFile , smallFile } from './fixtures/files.js'
14
+ import { getCodec } from './fixtures/get-codec.js'
15
15
import { memoryCarWriter } from './fixtures/memory-car.js'
16
16
import type { Blockstore } from 'interface-blockstore'
17
17
@@ -23,14 +23,14 @@ describe('import/export car file', () => {
23
23
beforeEach ( async ( ) => {
24
24
blockstore = new MemoryBlockstore ( )
25
25
26
- c = car ( { blockstore, dagWalkers } )
26
+ c = car ( { blockstore, getCodec } )
27
27
u = unixfs ( { blockstore } )
28
28
} )
29
29
30
30
it ( 'exports and imports a car file' , async ( ) => {
31
31
const otherBlockstore = new MemoryBlockstore ( )
32
32
const otherUnixFS = unixfs ( { blockstore : otherBlockstore } )
33
- const otherCar = car ( { blockstore : otherBlockstore , dagWalkers } )
33
+ const otherCar = car ( { blockstore : otherBlockstore , getCodec } )
34
34
const cid = await otherUnixFS . addBytes ( smallFile )
35
35
36
36
const writer = memoryCarWriter ( cid )
@@ -50,7 +50,7 @@ describe('import/export car file', () => {
50
50
51
51
const otherBlockstore = new MemoryBlockstore ( )
52
52
const otherUnixFS = unixfs ( { blockstore : otherBlockstore } )
53
- const otherCar = car ( { blockstore : otherBlockstore , dagWalkers } )
53
+ const otherCar = car ( { blockstore : otherBlockstore , getCodec } )
54
54
const cid1 = await otherUnixFS . addBytes ( fileData1 )
55
55
const cid2 = await otherUnixFS . addBytes ( fileData2 )
56
56
const cid3 = await otherUnixFS . addBytes ( fileData3 )
@@ -70,7 +70,7 @@ describe('import/export car file', () => {
70
70
it ( 'exports and imports a multiple block car file' , async ( ) => {
71
71
const otherBlockstore = new MemoryBlockstore ( )
72
72
const otherUnixFS = unixfs ( { blockstore : otherBlockstore } )
73
- const otherCar = car ( { blockstore : otherBlockstore , dagWalkers } )
73
+ const otherCar = car ( { blockstore : otherBlockstore , getCodec } )
74
74
const cid = await otherUnixFS . addBytes ( largeFile )
75
75
76
76
const writer = memoryCarWriter ( cid )
@@ -90,7 +90,7 @@ describe('import/export car file', () => {
90
90
91
91
const otherBlockstore = new MemoryBlockstore ( )
92
92
const otherUnixFS = unixfs ( { blockstore : otherBlockstore } )
93
- const otherCar = car ( { blockstore : otherBlockstore , dagWalkers } )
93
+ const otherCar = car ( { blockstore : otherBlockstore , getCodec } )
94
94
const cid1 = await otherUnixFS . addBytes ( fileData1 , {
95
95
chunker : fixedSize ( {
96
96
chunkSize : 2
@@ -124,7 +124,7 @@ describe('import/export car file', () => {
124
124
const otherUnixFS = unixfs ( { blockstore : otherBlockstore } )
125
125
const otherDatastore = new MemoryDatastore ( )
126
126
const otherMFS = mfs ( { blockstore : otherBlockstore , datastore : otherDatastore } )
127
- const otherCar = car ( { blockstore : otherBlockstore , dagWalkers } )
127
+ const otherCar = car ( { blockstore : otherBlockstore , getCodec } )
128
128
129
129
await otherMFS . mkdir ( '/testDups' )
130
130
await otherMFS . mkdir ( '/testDups/sub' )
@@ -151,7 +151,7 @@ describe('import/export car file', () => {
151
151
const otherUnixFS = unixfs ( { blockstore : otherBlockstore } )
152
152
const otherDatastore = new MemoryDatastore ( )
153
153
const otherMFS = mfs ( { blockstore : otherBlockstore , datastore : otherDatastore } )
154
- const otherCar = car ( { blockstore : otherBlockstore , dagWalkers } )
154
+ const otherCar = car ( { blockstore : otherBlockstore , getCodec } )
155
155
156
156
await otherMFS . mkdir ( '/testDups' )
157
157
await otherMFS . mkdir ( '/testDups/sub' )
0 commit comments