Hello folks at CKB DevRel,
I noticed that the block/header methods fail whenever verbosity is passed.
Minimal Reproduction
import { ccc } from "@ckb-ccc/core";
const owner = ccc.ClientPublicTestnet.open();
const client = owner.value;
for (const read of [
() => client.getTipHeader(0),
() => client.getTipHeader("0x0" as never),
() => client.getBlockByNumber(1, "0x0" as never),
() => client.getBlockByNumber(1, "0x2" as never, true),
]) {
console.log(await read().catch((error) => error.message));
}
await owner.dispose();
Behavior
Invalid parameter for `verbosity`: invalid type: integer `0`, expected a hex-encoded, 0x-prefixed Uint32
undefined is not iterable (cannot read property Symbol(Symbol.iterator))
Cannot read properties of undefined (reading 'dao')
Cannot read properties of undefined (reading 'dao')
The senders encode only the block number or hash, so a numeric verbosity reaches the node as a JSON number instead of the Uint32 hex string the node expects. A hex string gets past the node, but the serialized bytes and the with_cycles response then reach transformers that expect a decoded header or block. getBlockByHash, getHeaderByNumber and getHeaderByHash fail the same way.
Environment
@ckb-ccc/core@1.20.0, 1.20.1 and 1.22.0
- Node.js 24.18.0, Linux
Keep up the Great Work,
Phroi %31
Hello folks at CKB DevRel,
I noticed that the block/header methods fail whenever
verbosityis passed.Minimal Reproduction
Behavior
The senders encode only the block number or hash, so a numeric
verbosityreaches the node as a JSON number instead of theUint32hex string the node expects. A hex string gets past the node, but the serialized bytes and thewith_cyclesresponse then reach transformers that expect a decoded header or block.getBlockByHash,getHeaderByNumberandgetHeaderByHashfail the same way.Environment
@ckb-ccc/core@1.20.0,1.20.1and1.22.0Keep up the Great Work,
Phroi %31