Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Aug 17, 2023
1 parent 46cdaff commit 8335e2d
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 19 deletions.
8 changes: 1 addition & 7 deletions packages/portalnetwork/src/subprotocols/beacon/beacon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ import { Union } from '@chainsafe/ssz/lib/interface.js'
import { fromHexString, toHexString } from '@chainsafe/ssz'
import { shortId } from '../../util/util.js'
import { createBeaconConfig, defaultChainConfig, BeaconConfig } from '@lodestar/config'
import {
MainnetGenesisValidatorsRoot,
BeaconLightClientNetworkContentType,
LightClientUpdatesByRange,
} from './types.js'
import { MainnetGenesisValidatorsRoot, BeaconLightClientNetworkContentType } from './types.js'
import {
ContentMessageType,
FindContentMessage,
MessageCodes,
PortalWireMessageType,
} from '../../wire/types.js'
import { ssz } from '@lodestar/types'
import { getBeaconContentKey } from './util.js'
import { bytesToInt } from '@ethereumjs/util'
import { RequestCode } from '../../wire/index.js'

Expand Down
5 changes: 2 additions & 3 deletions packages/portalnetwork/src/subprotocols/history/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ export class HistoryProtocol extends BaseProtocol {
}
try {
this.verifyInclusionProof(proof.value, contentHash, header.number)
} catch (e) {
console.log(e)
} catch () {
throw new Error('Received block header with invalid proof')
}
}
Expand Down Expand Up @@ -209,7 +208,7 @@ export class HistoryProtocol extends BaseProtocol {
}

public async addBlockBody(value: Uint8Array, hashKey: string) {
const bodyKey = getContentKey(HistoryNetworkContentType.BlockBody, fromHexString(hashKey))
const _bodyKey = getContentKey(HistoryNetworkContentType.BlockBody, fromHexString(hashKey))
if (value.length === 0) {
// Occurs when `getBlockByHash` called `includeTransactions` === false
return
Expand Down
6 changes: 3 additions & 3 deletions packages/portalnetwork/src/subprotocols/state/state.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import debug, { Debugger } from 'debug'
import { PortalNetwork } from '../../client/client.js'
import { BaseProtocol } from '../protocol.js'
import { ProtocolId } from '../types.js'
import { ProtocolId } from '../../types.js'

export class StateProtocol extends BaseProtocol {
protocolId: ProtocolId.StateNetwork
Expand All @@ -14,11 +14,11 @@ export class StateProtocol extends BaseProtocol {
this.routingTable.setLogger(this.logger)
}

public sendFindContent = async (dstId: string, key: Uint8Array) => {
public sendFindContent = async (_dstId: string, _key: Uint8Array) => {
return undefined
}

public findContentLocally = async (contentKey: Uint8Array): Promise<Uint8Array | undefined> => {
public findContentLocally = async (_contentKey: Uint8Array): Promise<Uint8Array | undefined> => {
return undefined
}

Expand Down
2 changes: 1 addition & 1 deletion packages/portalnetwork/src/transports/capacitorUdp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class CapacitorUDPTransportService
}
}

getContactableAddr(enr: BaseENR): SocketAddress | undefined {
getContactableAddr(_enr: BaseENR): SocketAddress | undefined {
const nodeAddr = this.bindAddrs[0].tuples()
return {
port: this.bindAddrs[0].nodeAddress().port,
Expand Down
2 changes: 1 addition & 1 deletion packages/portalnetwork/src/transports/websockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class WebSocketTransportService
}
}

getContactableAddr(enr: BaseENR): SocketAddress | undefined {
getContactableAddr(_enr: BaseENR): SocketAddress | undefined {
const nodeAddr = this.bindAddrs[0].tuples()
return {
port: this.bindAddrs[0].nodeAddress().port,
Expand Down
1 change: 0 additions & 1 deletion packages/portalnetwork/src/wire/utp/Socket/UtpSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
Packet,
PacketType,
ConnectionState,
ICreate,
ICreatePacketOpts,
UtpSocketOptions,
UtpSocketType,
Expand Down
2 changes: 1 addition & 1 deletion packages/portalnetwork/test/client/db.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, assert } from 'vitest'
import { it, assert } from 'vitest'
import {
getContentId,
getContentKey,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createFromProtobuf } from '@libp2p/peer-id-factory'
import { multiaddr } from '@multiformats/multiaddr'
import { describe, it, assert } from 'vitest'
import { it, assert } from 'vitest'
import {
fromHexString,
PortalNetwork,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Block, BlockHeader } from '@ethereumjs/block'
import { createFromProtobuf } from '@libp2p/peer-id-factory'
import { multiaddr } from '@multiformats/multiaddr'
import { readFileSync } from 'fs'
import { it, it, assert } from 'vitest'
import { it, assert } from 'vitest'
import {
addRLPSerializedBlock,
BlockHeaderWithProof,
Expand Down

0 comments on commit 8335e2d

Please sign in to comment.