Skip to content

Commit f87b1c3

Browse files
deps(dev): bump aegir from 38.1.8 to 39.0.10 (libp2p#70)
* deps(dev): bump aegir from 38.1.8 to 39.0.10 Bumps [aegir](https://github.com/ipfs/aegir) from 38.1.8 to 39.0.10. - [Release notes](https://github.com/ipfs/aegir/releases) - [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md) - [Commits](ipfs/aegir@v38.1.8...v39.0.10) --- updated-dependencies: - dependency-name: aegir dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * chore: fix linting --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: achingbrain <[email protected]>
1 parent c03b6cd commit f87b1c3

9 files changed

+54
-54
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
},
160160
"devDependencies": {
161161
"@types/varint": "^6.0.0",
162-
"aegir": "^38.1.8",
162+
"aegir": "^39.0.10",
163163
"iso-random-stream": "^2.0.2",
164164
"it-all": "^3.0.1",
165165
"it-map": "^3.0.2",

src/handle.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { logger } from '@libp2p/logger'
2-
import * as multistream from './multistream.js'
32
import { handshake } from 'it-handshake'
4-
import { PROTOCOL_ID } from './constants.js'
5-
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
63
import { Uint8ArrayList } from 'uint8arraylist'
7-
import type { Duplex, Source } from 'it-stream-types'
4+
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
5+
import { PROTOCOL_ID } from './constants.js'
6+
import * as multistream from './multistream.js'
87
import type { ByteArrayInit, ByteListInit, MultistreamSelectInit, ProtocolStream } from './index.js'
8+
import type { Duplex, Source } from 'it-stream-types'
99

1010
const log = logger('libp2p:mss:handle')
1111

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { PROTOCOL_ID } from './constants.js'
2-
import type { Duplex, Source } from 'it-stream-types'
32
import type { AbortOptions } from '@libp2p/interfaces'
3+
import type { Duplex, Source } from 'it-stream-types'
44

55
export { PROTOCOL_ID }
66

src/multistream.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11

2-
import { Uint8ArrayList } from 'uint8arraylist'
2+
import { CodeError } from '@libp2p/interfaces/errors'
3+
import { logger } from '@libp2p/logger'
4+
import { abortableSource } from 'abortable-iterator'
5+
import first from 'it-first'
36
import * as lp from 'it-length-prefixed'
47
import { pipe } from 'it-pipe'
5-
import { CodeError } from '@libp2p/interfaces/errors'
8+
import { Uint8ArrayList } from 'uint8arraylist'
69
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
7-
import first from 'it-first'
8-
import { abortableSource } from 'abortable-iterator'
910
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
10-
import type { Pushable } from 'it-pushable'
11+
import { MAX_PROTOCOL_LENGTH } from './constants.js'
12+
import type { MultistreamSelectInit } from '.'
1113
import type { AbortOptions } from '@libp2p/interfaces'
12-
import type { Source } from 'it-stream-types'
14+
import type { Pushable } from 'it-pushable'
1315
import type { Reader } from 'it-reader'
14-
import type { MultistreamSelectInit } from '.'
15-
import { MAX_PROTOCOL_LENGTH } from './constants.js'
16-
import { logger } from '@libp2p/logger'
16+
import type { Source } from 'it-stream-types'
1717

1818
const log = logger('libp2p:mss')
1919

@@ -59,7 +59,7 @@ export async function read (reader: Reader, options?: AbortOptions): Promise<Uin
5959
let byteLength = 1 // Read single byte chunks until the length is known
6060
const varByteSource = { // No return impl - we want the reader to remain readable
6161
[Symbol.asyncIterator]: () => varByteSource,
62-
next: async () => await reader.next(byteLength)
62+
next: async () => reader.next(byteLength)
6363
}
6464

6565
let input: Source<Uint8ArrayList> = varByteSource
@@ -78,7 +78,7 @@ export async function read (reader: Reader, options?: AbortOptions): Promise<Uin
7878
const buf = await pipe(
7979
input,
8080
(source) => lp.decode(source, { onLength, maxDataLength: MAX_PROTOCOL_LENGTH }),
81-
async (source) => await first(source)
81+
async (source) => first(source)
8282
)
8383

8484
if (buf == null || buf.length === 0) {

src/select.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { logger } from '@libp2p/logger'
21
import { CodeError } from '@libp2p/interfaces/errors'
3-
import * as multistream from './multistream.js'
2+
import { logger } from '@libp2p/logger'
43
import { handshake } from 'it-handshake'
5-
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
6-
import { PROTOCOL_ID } from './index.js'
7-
import type { Duplex, Source } from 'it-stream-types'
8-
import { Uint8ArrayList } from 'uint8arraylist'
9-
import { pushable } from 'it-pushable'
104
import merge from 'it-merge'
5+
import { pushable } from 'it-pushable'
116
import { reader } from 'it-reader'
7+
import { Uint8ArrayList } from 'uint8arraylist'
8+
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
9+
import * as multistream from './multistream.js'
10+
import { PROTOCOL_ID } from './index.js'
1211
import type { ByteArrayInit, ByteListInit, MultistreamSelectInit, ProtocolStream } from './index.js'
12+
import type { Duplex, Source } from 'it-stream-types'
1313

1414
const log = logger('libp2p:mss:select')
1515

test/dialer.spec.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
/* eslint max-nested-callbacks: ["error", 5] */
33

44
import { expect } from 'aegir/chai'
5-
import { pipe } from 'it-pipe'
5+
import randomBytes from 'iso-random-stream/src/random.js'
66
import all from 'it-all'
7-
import { Uint8ArrayList } from 'uint8arraylist'
87
import { pair } from 'it-pair'
8+
import { pipe } from 'it-pipe'
99
import { reader } from 'it-reader'
1010
import pTimeout from 'p-timeout'
11-
import randomBytes from 'iso-random-stream/src/random.js'
12-
import * as Multistream from '../src/multistream.js'
13-
import * as mss from '../src/index.js'
11+
import { Uint8ArrayList } from 'uint8arraylist'
1412
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
13+
import * as mss from '../src/index.js'
14+
import * as Multistream from '../src/multistream.js'
1515

1616
describe('Dialer', () => {
1717
describe('dialer.select', () => {
@@ -26,7 +26,7 @@ describe('Dialer', () => {
2626

2727
// Ensure stream is usable after selection
2828
const input = [randomBytes(10), randomBytes(64), randomBytes(3)]
29-
const output = await pipe(input, selection.stream, async (source) => await all(source))
29+
const output = await pipe(input, selection.stream, async (source) => all(source))
3030
expect(new Uint8ArrayList(...output).slice()).to.eql(new Uint8ArrayList(...input).slice())
3131
})
3232

@@ -90,7 +90,7 @@ describe('Dialer', () => {
9090

9191
// Ensure stream is usable after selection
9292
const input = [new Uint8ArrayList(randomBytes(10), randomBytes(64), randomBytes(3))]
93-
const output = await pipe(input, selection.stream, async (source) => await all(source))
93+
const output = await pipe(input, selection.stream, async (source) => all(source))
9494
expect(new Uint8ArrayList(...output).slice()).to.eql(new Uint8ArrayList(...input).slice())
9595
})
9696

@@ -132,7 +132,7 @@ describe('Dialer', () => {
132132

133133
// Ensure stream is usable after selection
134134
const input = [randomBytes(10), randomBytes(64), randomBytes(3)]
135-
const output = await pipe(input, selection.stream, async (source) => await all(source))
135+
const output = await pipe(input, selection.stream, async (source) => all(source))
136136
expect(new Uint8ArrayList(...output).slice()).to.eql(new Uint8ArrayList(...input).slice())
137137
})
138138
})

test/integration.spec.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/* eslint-env mocha */
22

33
import { expect } from 'aegir/chai'
4-
import { pipe } from 'it-pipe'
4+
import randomBytes from 'iso-random-stream/src/random.js'
55
import all from 'it-all'
6+
import { duplexPair } from 'it-pair/duplex'
7+
import { pipe } from 'it-pipe'
68
import { Uint8ArrayList } from 'uint8arraylist'
7-
import randomBytes from 'iso-random-stream/src/random.js'
89
import * as mss from '../src/index.js'
9-
import { duplexPair } from 'it-pair/duplex'
1010

1111
describe('Dialer and Listener integration', () => {
1212
it('should handle and select', async () => {
@@ -25,7 +25,7 @@ describe('Dialer and Listener integration', () => {
2525
// Ensure stream is usable after selection
2626
const input = [new Uint8ArrayList(randomBytes(10), randomBytes(64), randomBytes(3))]
2727
const output = await Promise.all([
28-
pipe(input, dialerSelection.stream, async (source) => await all(source)),
28+
pipe(input, dialerSelection.stream, async (source) => all(source)),
2929
pipe(listenerSelection.stream, listenerSelection.stream)
3030
])
3131
expect(new Uint8ArrayList(...output[0]).slice()).to.eql(new Uint8ArrayList(...input).slice())
@@ -38,7 +38,7 @@ describe('Dialer and Listener integration', () => {
3838

3939
const [listenerSelection, dialerSelection] = await Promise.all([
4040
mss.handle(pair[1], selectedProtocol),
41-
(async () => await mss.select(pair[0], selectedProtocol))()
41+
(async () => mss.select(pair[0], selectedProtocol))()
4242
])
4343

4444
expect(dialerSelection.protocol).to.equal(selectedProtocol)
@@ -47,7 +47,7 @@ describe('Dialer and Listener integration', () => {
4747
// Ensure stream is usable after selection
4848
const input = [new Uint8ArrayList(randomBytes(10), randomBytes(64), randomBytes(3))]
4949
const output = await Promise.all([
50-
pipe(input, dialerSelection.stream, async (source) => await all(source)),
50+
pipe(input, dialerSelection.stream, async (source) => all(source)),
5151
pipe(listenerSelection.stream, listenerSelection.stream)
5252
])
5353
expect(new Uint8ArrayList(...output[0]).slice()).to.eql(new Uint8ArrayList(...input).slice())
@@ -69,7 +69,7 @@ describe('Dialer and Listener integration', () => {
6969
// Ensure stream is usable after selection
7070
const input = [randomBytes(10), randomBytes(64), randomBytes(3)]
7171
const output = await Promise.all([
72-
pipe(input, dialerSelection.stream, async (source) => await all(source)),
72+
pipe(input, dialerSelection.stream, async (source) => all(source)),
7373
pipe(listenerSelection.stream, listenerSelection.stream)
7474
])
7575
expect(new Uint8ArrayList(...output[0]).slice()).to.eql(new Uint8ArrayList(...input).slice())
@@ -85,7 +85,7 @@ describe('Dialer and Listener integration', () => {
8585
// Ensure stream is usable after selection
8686
const input = [new Uint8ArrayList(randomBytes(10), randomBytes(64), randomBytes(3))]
8787
// Since the stream is lazy, we need to write to it before handling
88-
const dialerOutPromise = pipe(input, dialerSelection.stream, async source => await all(source))
88+
const dialerOutPromise = pipe(input, dialerSelection.stream, async source => all(source))
8989

9090
const listenerSelection = await mss.handle(pair[1], protocol)
9191
expect(listenerSelection.protocol).to.equal(protocol)
@@ -106,7 +106,7 @@ describe('Dialer and Listener integration', () => {
106106
// Ensure stream is usable after selection
107107
const input = [new Uint8ArrayList(randomBytes(10), randomBytes(64), randomBytes(3))]
108108
// Since the stream is lazy, we need to write to it before handling
109-
const dialerResultPromise = pipe(input, dialerSelection.stream, async source => await all(source))
109+
const dialerResultPromise = pipe(input, dialerSelection.stream, async source => all(source))
110110

111111
// The error message from this varies depending on how much data got
112112
// written when the dialer receives the `na` response and closes the

test/listener.spec.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/* eslint-env mocha */
22

33
import { expect } from 'aegir/chai'
4-
import { pipe } from 'it-pipe'
5-
import { Uint8ArrayList } from 'uint8arraylist'
6-
import { reader } from 'it-reader'
4+
import randomBytes from 'iso-random-stream/src/random.js'
75
import all from 'it-all'
86
import * as Lp from 'it-length-prefixed'
9-
import * as Multistream from '../src/multistream.js'
10-
import randomBytes from 'iso-random-stream/src/random.js'
7+
import map from 'it-map'
8+
import { pipe } from 'it-pipe'
9+
import { reader } from 'it-reader'
10+
import { Uint8ArrayList } from 'uint8arraylist'
1111
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
1212
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
1313
import * as mss from '../src/index.js'
14-
import map from 'it-map'
14+
import * as Multistream from '../src/multistream.js'
1515
import type { Duplex, Source } from 'it-stream-types'
1616

1717
describe('Listener', () => {
@@ -123,7 +123,7 @@ describe('Listener', () => {
123123
(source) => Lp.decode(source),
124124
// Stringify and remove the newline
125125
(source) => map(source, (buf) => uint8ArrayToString(buf.subarray()).trim()),
126-
async (source) => await all(source)
126+
async (source) => all(source)
127127
)
128128

129129
expect(lsProtocols).to.deep.equal(handledProtocols)

test/multistream.spec.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
/* eslint max-nested-callbacks: ["error", 6] */
33

44
import { expect } from 'aegir/chai'
5-
import * as Varint from 'varint'
6-
import { Uint8ArrayList } from 'uint8arraylist'
5+
import all from 'it-all'
6+
import { pushable } from 'it-pushable'
77
import { reader } from 'it-reader'
8-
import * as Multistream from '../src/multistream.js'
9-
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
8+
import { Uint8ArrayList } from 'uint8arraylist'
109
import { concat as uint8ArrayConcat } from 'uint8arrays/concat'
11-
import { pushable } from 'it-pushable'
12-
import all from 'it-all'
10+
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
11+
import * as Varint from 'varint'
12+
import * as Multistream from '../src/multistream.js'
1313

1414
describe('Multistream', () => {
1515
describe('Multistream.encode', () => {

0 commit comments

Comments
 (0)