Skip to content

Commit

Permalink
lint: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottyPoi committed Aug 22, 2023
1 parent 218e566 commit 3269d1a
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 17 deletions.
4 changes: 3 additions & 1 deletion packages/cli/src/rpc/modules/ultralight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export class ultralight {
const [contentKey, value] = params

const type: number = parseInt(contentKey.slice(0, 4))
this.logger(`ultralight_addContentToDB request received for ${HistoryNetworkContentType[type]} ${contentKey}`)
this.logger(
`ultralight_addContentToDB request received for ${HistoryNetworkContentType[type]} ${contentKey}`,
)
try {
this._history.store(type, '0x' + contentKey.slice(4), fromHexString(value))
this.logger(`${type} value for 0x${contentKey.slice(4)} added to content DB`)
Expand Down
4 changes: 2 additions & 2 deletions packages/portalnetwork/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ export class PortalNetwork extends (EventEmitter as { new (): PortalNetworkEvent
value: JSON.stringify(peers),
},
])
} catch (err) {
console.log('error', err)
} catch (err: any) {
this.logger.log('error: ', err.message)
}
}

Expand Down
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 @@ -7,19 +7,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
1 change: 0 additions & 1 deletion packages/portalnetwork/src/subprotocols/contentLookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Debugger } from 'debug'
import { serializedContentKeyToContentId, shortId } from '../util/index.js'
import { HistoryNetworkContentType } from './history/types.js'
import { BaseProtocol } from './protocol.js'
import { Uint8 } from '@lodestar/types'

type lookupPeer = {
nodeId: NodeId
Expand Down
1 change: 0 additions & 1 deletion packages/portalnetwork/src/subprotocols/history/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ export class HistoryProtocol extends BaseProtocol {
}

public async addBlockBody(value: Uint8Array, hashKey: string) {
const bodyKey = getContentKey(HistoryNetworkContentType.BlockBody, fromHexString(hashKey))
if (value.length === 0) {
// Occurs when `getBlockByHash` called `includeTransactions` === false
return
Expand Down
4 changes: 2 additions & 2 deletions packages/portalnetwork/src/subprotocols/state/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
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/subprotocols/protocol.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '../../src/index.js'
import { createSecp256k1PeerId } from '@libp2p/peer-id-factory'
import { INodeAddress } from '@chainsafe/discv5/lib/session/nodeInfo.js'
import { BitArray, fromHexString, toHexString } from '@chainsafe/ssz'
import { BitArray, fromHexString } from '@chainsafe/ssz'

tape('protocol wire message tests', async (t) => {
const node = await PortalNetwork.create({
Expand Down
1 change: 0 additions & 1 deletion packages/portalnetwork/test/wire/utp/utp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ tape('PortalNetworkUTP test', (t) => {
})
t.test('handleNewRequest', async (st) => {
const connectionId = randUint16()
const socketIds = utp.startingIdNrs(connectionId)
let params: INewRequest = {
protocolId: ProtocolId.HistoryNetwork,
contentKeys: [randomBytes(33)],
Expand Down

0 comments on commit 3269d1a

Please sign in to comment.