Skip to content

Commit eb5b4dc

Browse files
vasco-santosGozala
andauthored
chore: apply suggestions from code review
Co-authored-by: Irakli Gozalishvili <[email protected]>
1 parent 1992609 commit eb5b4dc

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

Diff for: .github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v2
1515
- run: yarn
1616
- run: yarn lint
17-
# - uses: gozala/[email protected].4
17+
- uses: gozala/[email protected].8
1818
- run: yarn build
1919
- run: yarn aegir dep-check
2020
- uses: ipfs/aegir/actions/bundle-size@master
@@ -64,4 +64,4 @@ jobs:
6464
steps:
6565
- uses: actions/checkout@v2
6666
- run: yarn
67-
- run: cd examples && yarn && npm run test -- auto-relay
67+
- run: cd examples && yarn && npm run test -- auto-relay

Diff for: src/circuit/circuit/stop.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const { validateAddrs } = require('./utils')
1919
* Handles incoming STOP requests
2020
*
2121
* @private
22-
* @param {object} options
22+
* @param {Object} options
2323
* @param {Connection} options.connection
2424
* @param {CircuitPB} options.request - The CircuitRelay protobuf request (unencoded)
2525
* @param {StreamHandler} options.streamHandler
@@ -50,7 +50,7 @@ module.exports.handleStop = function handleStop ({
5050
* Creates a STOP request
5151
*
5252
* @private
53-
* @param {object} options
53+
* @param {Object} options
5454
* @param {Connection} options.connection
5555
* @param {CircuitPB} options.request - The CircuitRelay protobuf request (unencoded)
5656
* @returns {Promise<MuxedStream|void>} Resolves a duplex iterable

Diff for: src/circuit/circuit/stream-handler.js

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class StreamHandler {
4848
* Encode and write array of buffers
4949
*
5050
* @param {CircuitPB} msg - An unencoded CircuitRelay protobuf message
51+
* @returns {void}
5152
*/
5253
write (msg) {
5354
log('write message type %s', msg.type)

Diff for: src/connection-manager/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ const defaultOptions = {
5252
*/
5353

5454
/**
55-
* @extends EventEmitter
5655
*
5756
* @fires ConnectionManager#peer:connect Emitted when a new peer is connected.
5857
* @fires ConnectionManager#peer:disconnect Emitted when a peer is disconnected.

Diff for: src/content-routing.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class ContentRouting {
7272
* @param {CID} key - The CID key of the content to find
7373
* @returns {Promise<void[]>}
7474
*/
75-
async provide (key) { // eslint-disable-line require-await
75+
provide (key) {
7676
if (!this.routers.length) {
7777
throw errCode(new Error('No content routers available'), 'NO_ROUTERS_AVAILABLE')
7878
}
@@ -89,7 +89,7 @@ class ContentRouting {
8989
* @param {number} [options.minPeers] - minimum number of peers required to successfully put
9090
* @returns {Promise<void>}
9191
*/
92-
async put (key, value, options) { // eslint-disable-line require-await
92+
put (key, value, options) {
9393
if (!this.libp2p.isStarted() || !this.dht.isStarted) {
9494
throw errCode(new Error(messages.NOT_STARTED_YET), codes.DHT_NOT_STARTED)
9595
}
@@ -106,7 +106,7 @@ class ContentRouting {
106106
* @param {number} [options.timeout] - optional timeout (default: 60000)
107107
* @returns {Promise<GetData>}
108108
*/
109-
async get (key, options) { // eslint-disable-line require-await
109+
get (key, options) {
110110
if (!this.libp2p.isStarted() || !this.dht.isStarted) {
111111
throw errCode(new Error(messages.NOT_STARTED_YET), codes.DHT_NOT_STARTED)
112112
}

Diff for: src/ping/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async function ping (node, peer) {
3333

3434
const { stream } = await node.dialProtocol(peer, PROTOCOL)
3535

36-
const start = new Date().getTime()
36+
const start = Date.now()
3737
const data = crypto.randomBytes(PING_LENGTH)
3838

3939
const [result] = await pipe(

0 commit comments

Comments
 (0)