@@ -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