ChainSafe / discv5

A Typescript implementation of the Discv5 protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Error] Offset is outside the bounds of the DataView

valamidev opened this issue · comments

commented

I am getting the following error while Decode this Payload:

ENR.decodeTxt("T1WJc2VjcDI1NmsxoQJbQ9BY7wgWhlf7QvAS0iJWw5L30RQyN8bSQ15Car-v0YRzbmFwwIN0Y3Bfg3VkcF8")

Fail here:

export function getProtocolValue(kvs, key) {
    const raw = kvs.get(key);
    if (raw) {
        const view = new DataView(raw.buffer, raw.byteOffset, raw.byteLength);
        return view.getUint16(0); 
    }
    else {
        return undefined;
    }
}