fix: transport manager fault tolerance should include tolerance to transport listen fail (#893)

This commit is contained in:
Vasco Santos
2021-02-25 15:23:07 +01:00
committed by GitHub
parent 4ee3e1973b
commit 3f314d5e90
2 changed files with 20 additions and 2 deletions

View File

@@ -209,7 +209,7 @@ describe('libp2p.transportManager (dial only)', () => {
throw new Error('it should fail to start if multiaddr fails to listen')
})
it('does not fail to start if multiaddr fails to listen when supporting dial only mode', async () => {
it('does not fail to start if provided listen multiaddr are not compatible to configured transports (when supporting dial only mode)', async () => {
libp2p = new Libp2p({
peerId,
addresses: {
@@ -226,4 +226,22 @@ describe('libp2p.transportManager (dial only)', () => {
await libp2p.start()
})
it('does not fail to start if provided listen multiaddr fail to listen on configured transports (when supporting dial only mode)', async () => {
libp2p = new Libp2p({
peerId,
addresses: {
listen: [multiaddr('/ip4/127.0.0.1/tcp/12345/p2p/QmWDn2LY8nannvSWJzruUYoLZ4vV83vfCBwd8DipvdgQc3/p2p-circuit')]
},
transportManager: {
faultTolerance: FaultTolerance.NO_FATAL
},
modules: {
transport: [Transport],
connEncryption: [Crypto]
}
})
await libp2p.start()
})
})