Skip to content

Commit 29f2ba0

Browse files
author
foufrix
committed
fix: import AcceptCode
1 parent 2476bd0 commit 29f2ba0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

packages/cli/src/rpc/util.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { BitArray } from '@chainsafe/ssz'
22
import { INTERNAL_ERROR, type RpcError } from './types.js'
3+
import { AcceptCode } from 'portalnetwork'
34

45
export const isValidId = (nodeId: string) => {
56
return /[^a-z0-9\s]+/.test(nodeId) || nodeId.length !== 64 ? false : true
@@ -50,6 +51,8 @@ export function bitToBooleanArray(resBitArray: BitArray, contentKeysLength: numb
5051
export function Uint8toBooleanArray(res: Uint8Array, contentKeysLength: number): { success: boolean[] } {
5152
const successArray = new Array(contentKeysLength).fill(false)
5253
for (let i = 0; i < contentKeysLength; i++) {
54+
const byteIndex = Math.floor(i / 8)
55+
const byte = res[byteIndex]
5356
if (byte !== undefined) {
5457
successArray[i] = AcceptCode.ACCEPT
5558
}

0 commit comments

Comments
 (0)