@@ -18,8 +18,10 @@ const PeerBook = require('peer-book')
1818const Message = require ( '../src/types/message' )
1919const Bitswap = require ( '../src' )
2020
21- const utils = require ( './utils' )
22- const makeBlock = utils . makeBlock
21+ const mockNetwork = require ( './utils/mock-network' ) . mockNetwork
22+ const applyNetwork = require ( './utils/mock-network' ) . applyNetwork
23+
24+ const makeBlock = require ( './utils/make-block' )
2325
2426function hasBlocks ( msg , store , cb ) {
2527 each ( msg . blocks . values ( ) , ( b , cb ) => {
@@ -256,7 +258,7 @@ module.exports = (repo) => {
256258 it ( 'block is added locally afterwards' , ( done ) => {
257259 const block = blocks [ 9 ]
258260 const bs = new Bitswap ( createLibp2pMock ( ) , store )
259- const net = utils . mockNetwork ( )
261+ const net = mockNetwork ( )
260262
261263 bs . network = net
262264 bs . wm . network = net
@@ -328,7 +330,7 @@ module.exports = (repo) => {
328330 }
329331 }
330332 bs1 = new Bitswap ( libp2pMock , store )
331- utils . applyNetwork ( bs1 , n1 )
333+ applyNetwork ( bs1 , n1 )
332334 bs1 . start ( )
333335
334336 let store2
@@ -338,7 +340,7 @@ module.exports = (repo) => {
338340 ( repo , cb ) => {
339341 store2 = repo . blocks
340342 bs2 = new Bitswap ( createLibp2pMock ( ) , store2 )
341- utils . applyNetwork ( bs2 , n2 )
343+ applyNetwork ( bs2 , n2 )
342344 bs2 . start ( )
343345 bs1 . _onPeerConnected ( other )
344346 bs2 . _onPeerConnected ( me )
0 commit comments