Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI makes me sad #35

Merged
merged 2 commits into from
Sep 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/network/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ const Message = require('../message')
const cs = require('../constants')
const log = debug('bitswap:network')

// Go does not yet support /1.0.0
// const PROTOCOL_IDENTIFIER = '/ipfs/bitswap/1.0.0'
const PROTOCOL_IDENTIFIER = '/ipfs/bitswap'
const PROTOCOL_IDENTIFIER = '/ipfs/bitswap/1.0.0'

module.exports = class Network {
constructor (libp2p, peerBook, bitswap) {
Expand Down
49 changes: 11 additions & 38 deletions test/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ module.exports = (repo) => {
}

describe('bitswap', () => {
describe('receive message', () => {
let store
let store

beforeEach((done) => {
repo.create('hello', (err, r) => {
if (err) return done(err)
store = r.blockstore
done()
})
before((done) => {
repo.create('hello', (err, r) => {
if (err) return done(err)
store = r.blockstore
done()
})
})

afterEach((done) => {
repo.remove(done)
})
after((done) => {
repo.remove(done)
})

describe('receive message', () => {
it('simple block message', (done) => {
const me = PeerId.create({bits: 64})
const book = new PeerBook()
Expand Down Expand Up @@ -134,20 +134,6 @@ module.exports = (repo) => {
})

describe('getStream', () => {
let store

before((done) => {
repo.create('hello', (err, r) => {
if (err) return done(err)
store = r.blockstore
done()
})
})

after((done) => {
repo.remove(done)
})

it('block exists locally', (done) => {
const me = PeerId.create({bits: 64})
const block = makeBlock()
Expand Down Expand Up @@ -350,19 +336,6 @@ module.exports = (repo) => {
})

describe('unwant', () => {
let store
beforeEach((done) => {
repo.create('hello', (err, r) => {
if (err) return done(err)
store = r.blockstore
done()
})
})

afterEach((done) => {
repo.remove(done)
})

it('removes blocks that are wanted multiple times', (done) => {
const me = PeerId.create({bits: 64})
const bs = new Bitswap(me, libp2pMock, store, new PeerBook())
Expand Down
2 changes: 1 addition & 1 deletion test/network/network.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ describe('network', function () {
expect(err).to.not.exist
}

libp2pNodeA.dialByPeerInfo(peerInfoB, '/ipfs/bitswap', (err, conn) => {
libp2pNodeA.dialByPeerInfo(peerInfoB, '/ipfs/bitswap/1.0.0', (err, conn) => {
expect(err).to.not.exist

pull(
Expand Down