We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2476bd0 commit 29f2ba0Copy full SHA for 29f2ba0
1 file changed
packages/cli/src/rpc/util.ts
@@ -1,5 +1,6 @@
1
import { BitArray } from '@chainsafe/ssz'
2
import { INTERNAL_ERROR, type RpcError } from './types.js'
3
+import { AcceptCode } from 'portalnetwork'
4
5
export const isValidId = (nodeId: string) => {
6
return /[^a-z0-9\s]+/.test(nodeId) || nodeId.length !== 64 ? false : true
@@ -50,6 +51,8 @@ export function bitToBooleanArray(resBitArray: BitArray, contentKeysLength: numb
50
51
export function Uint8toBooleanArray(res: Uint8Array, contentKeysLength: number): { success: boolean[] } {
52
const successArray = new Array(contentKeysLength).fill(false)
53
for (let i = 0; i < contentKeysLength; i++) {
54
+ const byteIndex = Math.floor(i / 8)
55
+ const byte = res[byteIndex]
56
if (byte !== undefined) {
57
successArray[i] = AcceptCode.ACCEPT
58
}
0 commit comments