CKB Pulse
Lições

O que a CKB aprendeu

Começa aqui · Glossário · Testa-te · Feed

As lições estão escritas em inglês, por isso pesquise em inglês.

CECILIA-MULANDI/zk-Lock

Lições de CECILIA-MULANDI/zk-Lock

github.com/CECILIA-MULANDI/zk-Lock

Manténs este projeto? Confirma as lições dele num só issue

2 lições encontradas. Todas as lições

Assert the specific script error code in ckb-testtool rejection testsPráticoDe uma correção

In ckb-testtool tests, checking only that `context.verify_tx(&tx, MAX_CYCLES)` returns an error lets a test keep passing even if the targeted check is deleted from the script, because a badly built transaction usually fails for several reasons. This commit matches the script's exit code in the error string instead (`err.contains("error code {code} ")`), one constant per error discriminant of the script.

#Testing and devnet · Fontes (1) · 2026-11-05

completeFeeBy adds change instead of shrinking outputs, breaking output bound proofsPráticoDe uma correção

When a lock script commits to output 0's exact bytes (capacity included), the capacity must be decided before proving and must equal what the transaction ships. In CCC, tx.completeFeeBy(signer) pays the fee by pulling in the signer's cells and adding a change output, so output 0 keeps its capacity and the fee is then paid from extra inputs, which breaks the binding if the proof assumed inputCapacity minus fee. Instead compute the fee from tx.toBytes().length with the witness already at its final length, build output 0 at inputCapacity minus that fee, and check before sending that the fee recomputed on the real transaction equals the planned one.

#Transaction building and fees #Witnesses and signatures #Capacity and cell size · Fontes (1) · 2026-11-04

Texto sob CC BY 4.0: dá crédito à LusoCryptoLabs, CKB lessons, com uma ligação para a lição. JSON · Queres que uma lição seja mudada ou retirada? Abre um issue.