@@ -23,7 +23,7 @@ import type { PeerStore, Peer } from '@libp2p/interface/peer-store'
23
23
import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'
24
24
25
25
describe ( 'auto-dial' , ( ) => {
26
- let autoDialler : AutoDial
26
+ let autoDialer : AutoDial
27
27
let events : TypedEventTarget < Libp2pEvents >
28
28
let peerStore : PeerStore
29
29
let peerId : PeerId
@@ -39,8 +39,8 @@ describe('auto-dial', () => {
39
39
} )
40
40
41
41
afterEach ( ( ) => {
42
- if ( autoDialler != null ) {
43
- autoDialler . stop ( )
42
+ if ( autoDialer != null ) {
43
+ autoDialer . stop ( )
44
44
}
45
45
} )
46
46
@@ -74,16 +74,16 @@ describe('auto-dial', () => {
74
74
getDialQueue : Sinon . stub ( ) . returns ( [ ] )
75
75
} )
76
76
77
- autoDialler = new AutoDial ( defaultComponents ( {
77
+ autoDialer = new AutoDial ( defaultComponents ( {
78
78
peerStore,
79
79
connectionManager,
80
80
events
81
81
} ) , {
82
82
minConnections : 10 ,
83
83
autoDialInterval : 10000
84
84
} )
85
- autoDialler . start ( )
86
- void autoDialler . autoDial ( )
85
+ autoDialer . start ( )
86
+ void autoDialer . autoDial ( )
87
87
88
88
await pWaitFor ( ( ) => {
89
89
return connectionManager . openConnection . callCount === 1
@@ -128,15 +128,15 @@ describe('auto-dial', () => {
128
128
getDialQueue : Sinon . stub ( ) . returns ( [ ] )
129
129
} )
130
130
131
- autoDialler = new AutoDial ( defaultComponents ( {
131
+ autoDialer = new AutoDial ( defaultComponents ( {
132
132
peerStore,
133
133
connectionManager,
134
134
events
135
135
} ) , {
136
136
minConnections : 10
137
137
} )
138
- autoDialler . start ( )
139
- await autoDialler . autoDial ( )
138
+ autoDialer . start ( )
139
+ await autoDialer . autoDial ( )
140
140
141
141
await pWaitFor ( ( ) => connectionManager . openConnection . callCount === 1 )
142
142
await delay ( 1000 )
@@ -182,15 +182,15 @@ describe('auto-dial', () => {
182
182
} ] )
183
183
} )
184
184
185
- autoDialler = new AutoDial ( defaultComponents ( {
185
+ autoDialer = new AutoDial ( defaultComponents ( {
186
186
peerStore,
187
187
connectionManager,
188
188
events
189
189
} ) , {
190
190
minConnections : 10
191
191
} )
192
- autoDialler . start ( )
193
- await autoDialler . autoDial ( )
192
+ autoDialer . start ( )
193
+ await autoDialer . autoDial ( )
194
194
195
195
await pWaitFor ( ( ) => connectionManager . openConnection . callCount === 1 )
196
196
await delay ( 1000 )
@@ -208,20 +208,20 @@ describe('auto-dial', () => {
208
208
getDialQueue : Sinon . stub ( ) . returns ( [ ] )
209
209
} )
210
210
211
- autoDialler = new AutoDial ( defaultComponents ( {
211
+ autoDialer = new AutoDial ( defaultComponents ( {
212
212
peerStore,
213
213
connectionManager,
214
214
events
215
215
} ) , {
216
216
minConnections : 10 ,
217
217
autoDialInterval : 10000
218
218
} )
219
- autoDialler . start ( )
219
+ autoDialer . start ( )
220
220
221
221
// call autodial twice
222
222
await Promise . all ( [
223
- autoDialler . autoDial ( ) ,
224
- autoDialler . autoDial ( )
223
+ autoDialer . autoDial ( ) ,
224
+ autoDialer . autoDial ( )
225
225
] )
226
226
227
227
// should only have queried peer store once
@@ -259,17 +259,17 @@ describe('auto-dial', () => {
259
259
getDialQueue : Sinon . stub ( ) . returns ( [ ] )
260
260
} )
261
261
262
- autoDialler = new AutoDial ( defaultComponents ( {
262
+ autoDialer = new AutoDial ( defaultComponents ( {
263
263
peerStore,
264
264
connectionManager,
265
265
events
266
266
} ) , {
267
267
minConnections : 10 ,
268
268
autoDialPeerRetryThreshold : 2000
269
269
} )
270
- autoDialler . start ( )
270
+ autoDialer . start ( )
271
271
272
- void autoDialler . autoDial ( )
272
+ void autoDialer . autoDial ( )
273
273
274
274
await pWaitFor ( ( ) => {
275
275
return connectionManager . openConnection . callCount === 1
@@ -283,7 +283,7 @@ describe('auto-dial', () => {
283
283
await delay ( 2000 )
284
284
285
285
// autodial again
286
- void autoDialler . autoDial ( )
286
+ void autoDialer . autoDial ( )
287
287
288
288
await pWaitFor ( ( ) => {
289
289
return connectionManager . openConnection . callCount === 3
0 commit comments