Skip to content

Commit

Permalink
RPC: change expected contentkey type to uint8array
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottyPoi committed Sep 20, 2024
1 parent 2eb82e9 commit b828713
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/cli/src/rpc/modules/portal.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { EntryStatus } from '@chainsafe/discv5'
import { ENR } from '@chainsafe/enr'
import { BitArray } from '@chainsafe/ssz'
import { bytesToHex } from '@ethereumjs/util'
import {
ContentLookup,
ContentMessageType,
Expand Down Expand Up @@ -658,8 +659,8 @@ export class portal {
const timeout = setTimeout(() => {
resolve(Uint8Array.from([]))
}, 10000)
this._history.on('ContentAdded', (_contentKey: string, value: Uint8Array) => {
if (_contentKey === contentKey) {
this._history.on('ContentAdded', (_contentKey: Uint8Array, value: Uint8Array) => {
if (bytesToHex(_contentKey) === contentKey) {
clearTimeout(timeout)
resolve(value)
}
Expand Down Expand Up @@ -705,8 +706,8 @@ export class portal {
const timeout = setTimeout(() => {
resolve(Uint8Array.from([]))
}, 2000)
this._state.on('ContentAdded', (hash: string, value: Uint8Array) => {
if (hash === contentKey) {
this._state.on('ContentAdded', (_contentKey: Uint8Array, value: Uint8Array) => {
if (bytesToHex(_contentKey) === contentKey) {
clearTimeout(timeout)
resolve(value)
}
Expand Down

0 comments on commit b828713

Please sign in to comment.