CKB Pulse
经验

CKB 学到了什么

从这里开始 · 术语表 · 自测 · 订阅

经验用英文撰写,请用英文搜索。

CECILIA-MULANDI/zk-Lock

来自 CECILIA-MULANDI/zk-Lock 的经验

github.com/CECILIA-MULANDI/zk-Lock

你维护这个项目吗? 在一个 issue 中确认它的经验

找到 2 条经验。 全部经验

Assert the specific script error code in ckb-testtool rejection tests实践来自一次修复

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 · 来源(1) · 2026-11-05

completeFeeBy adds change instead of shrinking outputs, breaking output bound proofs实践来自一次修复

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 · 来源(1) · 2026-11-04

文本采用 CC BY 4.0:请署名 LusoCryptoLabs, CKB lessons,并附上经验的链接。 JSON · 想修改或撤下某条经验?请提交 issue。