Todas as lições · CCC (TypeScript SDK) · Começa aqui · Glossário
Convert Fiber RPC snake_case scripts to CCC camelCase ScriptLikePráticoReproduzida
Reproduzida · Verificação: certa · Verificada em 2026-11-19
Fiber RPC returns scripts as { code_hash, hash_type, args }, but CCC's ScriptLike expects { codeHash, hashType, args }. In this commit a Fiber shaped lock was passed to a CCC based sweep as if it were a ccc.ScriptLike and the sweep failed, so map the fields explicitly before handing the script to CCC.
Porque importa: If a Fiber snake_case script is passed where CCC expects a ScriptLike, codeHash and hashType come through undefined, so the hosted settlement sweep failed and the user's funds were not swept.
Padrão
{ codeHash: to.code_hash, hashType: to.hash_type, args: to.args }Tirado do commit, encurtado.
Reproduzida por um teste
Um teste público corre o que esta lição diz em @ckb-ccc/core 1.23.1, sem nó. Qualquer pessoa o pode correr.
tests/ccc/fiber-snake-case-script.test.mjs
- Conceitos
- Data encoding (molecule, hex, bigints), Channels and payments
- Evidência
- Reproduzida: reproduzida por um teste público
- Vista pela primeira vez
- 2026-10-14
- Última mudança
- 2026-10-14
- Última verificação
- 2026-11-19
- Verificação contra o commit
- certa: a lição sai do commit e continua a valer no código de hoje
Fontes (1)
- 2026-10-14 · officialcmg/ckb-keyway · mais deste projeto
Mais sobre CCC (TypeScript SDK)
- Hand-rolled Script hash: hash_type byte mapping and molecule offsets, checked against CCC
- Parsing snake_case JSON-RPC transactions in CCC
- Use JsonRpcTransformers.transactionFrom to serialize CCC transactions for CKB/Fiber RPC
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Convert Fiber RPC snake_case scripts to CCC camelCase ScriptLike", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/convert-fiber-rpc-snake-case-scripts-to-ccc-camelcase-script, CC BY 4.0, last changed 2026-10-14.