mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-12 08:41:22 +00:00
refactor: async identify and identify push (#473)
* chore: add missing dep * feat: import from identify push branch https://github.com/libp2p/js-libp2p-identify/tree/feat/identify-push * feat: add the connection to stream handlers * refactor: identify to async/await * chore: fix lint * test: add identify tests * refactor: add identify to the dialer flow * feat: connect identify to the registrar * fix: resolve review feedback * fix: perform identify push when our protocols change
This commit is contained in:
@ -361,16 +361,14 @@ describe('libp2p.upgrader', () => {
|
||||
}
|
||||
})
|
||||
|
||||
expect(libp2p.upgrader.protocols.size).to.equal(0)
|
||||
expect(libp2p.upgrader.protocols).to.not.have.any.keys(['/echo/1.0.0', '/echo/1.0.1'])
|
||||
|
||||
const echoHandler = () => {}
|
||||
libp2p.handle(['/echo/1.0.0', '/echo/1.0.1'], echoHandler)
|
||||
expect(libp2p.upgrader.protocols.size).to.equal(2)
|
||||
expect(libp2p.upgrader.protocols.get('/echo/1.0.0')).to.equal(echoHandler)
|
||||
expect(libp2p.upgrader.protocols.get('/echo/1.0.1')).to.equal(echoHandler)
|
||||
|
||||
libp2p.unhandle(['/echo/1.0.0'])
|
||||
expect(libp2p.upgrader.protocols.size).to.equal(1)
|
||||
expect(libp2p.upgrader.protocols.get('/echo/1.0.0')).to.equal(undefined)
|
||||
expect(libp2p.upgrader.protocols.get('/echo/1.0.1')).to.equal(echoHandler)
|
||||
})
|
||||
|
Reference in New Issue
Block a user