Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit e6ef445

Browse files
committed
fix: bitswap mock test
1 parent 8490a7d commit e6ef445

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/block-service-test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,17 @@ module.exports = (repo) => {
207207
const bitswap = {
208208
getStream (key) {
209209
return pull.values([
210-
new Block(key)
210+
new Block('secret')
211211
])
212212
}
213213
}
214214

215215
bs.goOnline(bitswap)
216216

217-
bs.get('secret', (err, block) => {
217+
const block = new Block('secret')
218+
const cid = new CID(block.key('sha2-256'))
219+
220+
bs.get(cid, (err, block) => {
218221
expect(err).to.not.exist
219222
expect(block.data).to.be.eql(new Block('secret').data)
220223
done()

0 commit comments

Comments
 (0)