Skip to content

Commit 4d8a69c

Browse files
committed
more lint
1 parent 40f429d commit 4d8a69c

2 files changed

Lines changed: 14 additions & 16 deletions

File tree

packages/portalnetwork/src/networks/contentLookup.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ export class ContentLookup {
4242
this.completedRequests = trace ? new Map() : undefined
4343
this.contentTrace = trace
4444
? {
45-
origin: ('0x' + this.network.portal.discv5.enr.nodeId) as PrefixedHexString,
46-
targetId: Array.from(hexToBytes(`0x${this.contentId}`)) as any,
47-
metadata: {},
48-
}
45+
origin: ('0x' + this.network.portal.discv5.enr.nodeId) as PrefixedHexString,
46+
targetId: Array.from(hexToBytes(`0x${this.contentId}`)) as any,
47+
metadata: {},
48+
}
4949
: undefined
5050
}
5151

@@ -240,7 +240,7 @@ export class ContentLookup {
240240
}
241241
} catch (err) {
242242
this.pending.delete(peer.enr.encodeTxt())
243-
if (signal?.aborted) {
243+
if (signal?.aborted === true) {
244244
this.logger(`Request to ${shortId(peer.enr.nodeId)} was cancelled`)
245245
}
246246
throw err

packages/portalnetwork/src/networks/history/history.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class HistoryNetwork extends BaseNetwork {
100100
}
101101

102102
public blockHashToNumber(blockHash: Uint8Array): bigint | undefined {
103-
const blockNumber = this.blockHashIndex.get(bytesToHex(blockHash) as PrefixedHexString)
103+
const blockNumber = this.blockHashIndex.get(bytesToHex(blockHash))
104104
return blockNumber === undefined ? undefined : BigInt(blockNumber)
105105
}
106106

@@ -437,7 +437,7 @@ export class HistoryNetwork extends BaseNetwork {
437437
)
438438
value = payload
439439
} catch (err: any) {
440-
if (err.message.includes('Header not found')) {
440+
if (err.message.includes('Header not found') === true) {
441441
this.logger.extend('FOUNDCONTENT').extend('EPHEMERALHEADERS')(
442442
`Header not found for ${bytesToHex(ck.keyOpt.blockHash)}, sending empty ephemeral headers response to ${shortId(src.nodeId)}`,
443443
)
@@ -470,10 +470,10 @@ export class HistoryNetwork extends BaseNetwork {
470470
) {
471471
this.logger.extend('FOUNDCONTENT')(
472472
'Found value for requested content ' +
473-
bytesToHex(decodedContentMessage.contentKey) +
474-
' ' +
475-
bytesToHex(value.slice(0, 10)) +
476-
'...',
473+
bytesToHex(decodedContentMessage.contentKey) +
474+
' ' +
475+
bytesToHex(value.slice(0, 10)) +
476+
'...',
477477
)
478478
const payload = ContentMessageType.serialize({
479479
selector: FoundContent.CONTENT,
@@ -661,8 +661,7 @@ export class HistoryNetwork extends BaseNetwork {
661661
}
662662
}
663663
this.logger(
664-
`${HistoryNetworkContentType[contentType]} added for ${
665-
keyOpt instanceof Uint8Array ? bytesToHex(keyOpt) : keyOpt
664+
`${HistoryNetworkContentType[contentType]} added for ${keyOpt instanceof Uint8Array ? bytesToHex(keyOpt) : keyOpt
666665
}`,
667666
)
668667
}
@@ -774,8 +773,7 @@ export class HistoryNetwork extends BaseNetwork {
774773
version: Version,
775774
) {
776775
this.logger.extend('ACCEPT')(
777-
`Received from ${shortId(src.nodeId, this.routingTable)} with ${
778-
msg.contentKeys.length
776+
`Received from ${shortId(src.nodeId, this.routingTable)} with ${msg.contentKeys.length
779777
} pieces of content.`,
780778
)
781779
const decodedContentKeys = msg.contentKeys.map((key) => decodeHistoryNetworkContentKey(key))
@@ -784,7 +782,7 @@ export class HistoryNetwork extends BaseNetwork {
784782
if (decodedContentKeys[0].contentType === HistoryNetworkContentType.EphemeralHeaderOffer) {
785783
this.logger.extend('OFFER').extend('EPHEMERALHEADERS')(
786784
'Received offer for ephemeral headers starting with block hash: ' +
787-
bytesToHex(decodedContentKeys[0].keyOpt as Uint8Array),
785+
bytesToHex(decodedContentKeys[0].keyOpt),
788786
)
789787
const contentIds: number[] = Array(msg.contentKeys.length).fill(AcceptCode.GENERIC_DECLINE)
790788
const desiredContentKeys: Uint8Array[] = []

0 commit comments

Comments
 (0)