mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-13 01:01:23 +00:00
fix: add transport manager to exports map and fix docs (#1182)
Addresses PR comments from #1172 - fixes syntax of examples in docs, adds the transport manager to the exports map and renames fault tolerance enum for consistency.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
import { expect } from 'aegir/utils/chai.js'
|
||||
import { DefaultAddressManager } from '../../src/address-manager/index.js'
|
||||
import { DefaultTransportManager, FAULT_TOLERANCE } from '../../src/transport-manager.js'
|
||||
import { DefaultTransportManager, FaultTolerance } from '../../src/transport-manager.js'
|
||||
import { TCP } from '@libp2p/tcp'
|
||||
import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'
|
||||
import { NatManager } from '../../src/nat-manager.js'
|
||||
@ -30,7 +30,7 @@ describe('Nat Manager (TCP)', () => {
|
||||
})
|
||||
components.setAddressManager(new DefaultAddressManager(components, { listen: addrs }))
|
||||
components.setTransportManager(new DefaultTransportManager(components, {
|
||||
faultTolerance: FAULT_TOLERANCE.NO_FATAL
|
||||
faultTolerance: FaultTolerance.NO_FATAL
|
||||
}))
|
||||
|
||||
const natManager = new NatManager(components, {
|
||||
|
@ -7,7 +7,7 @@ import { WebSockets } from '@libp2p/websockets'
|
||||
import * as filters from '@libp2p/websockets/filters'
|
||||
import { NOISE } from '@chainsafe/libp2p-noise'
|
||||
import { DefaultAddressManager } from '../../src/address-manager/index.js'
|
||||
import { DefaultTransportManager, FAULT_TOLERANCE } from '../../src/transport-manager.js'
|
||||
import { DefaultTransportManager, FaultTolerance } from '../../src/transport-manager.js'
|
||||
import { mockUpgrader } from '@libp2p/interface-compliance-tests/mocks'
|
||||
import { MULTIADDRS_WEBSOCKETS } from '../fixtures/browser.js'
|
||||
import { codes as ErrorCodes } from '../../src/errors.js'
|
||||
@ -123,7 +123,7 @@ describe('libp2p.transportManager (dial only)', () => {
|
||||
listen: ['/ip4/127.0.0.1/tcp/0']
|
||||
},
|
||||
transportManager: {
|
||||
faultTolerance: FAULT_TOLERANCE.NO_FATAL
|
||||
faultTolerance: FaultTolerance.NO_FATAL
|
||||
},
|
||||
transports: [
|
||||
new WebSockets()
|
||||
@ -143,7 +143,7 @@ describe('libp2p.transportManager (dial only)', () => {
|
||||
listen: ['/ip4/127.0.0.1/tcp/12345/p2p/QmWDn2LY8nannvSWJzruUYoLZ4vV83vfCBwd8DipvdgQc3/p2p-circuit']
|
||||
},
|
||||
transportManager: {
|
||||
faultTolerance: FAULT_TOLERANCE.NO_FATAL
|
||||
faultTolerance: FaultTolerance.NO_FATAL
|
||||
},
|
||||
transports: [
|
||||
new WebSockets()
|
||||
|
Reference in New Issue
Block a user