Todas as lições · Other · Começa aqui · Glossário
Restrict script hashType to data, type, data1, data2 when loading configPráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 2026-11-19
CKB hash_type encodes as data=0, type=1, data1=2, data2=4 (no value 3), so a config loader should reject any hashType string outside data/type/data1/data2 rather than map it loosely. A wrong code hash or hash type makes cell discovery watch the wrong cells and silently return empty results.
Porque importa: A loosely parsed hashType can silently land on a real but wrong hash type, so discovery watches the wrong cells and returns an empty result that looks like a round that has not opened yet.
hash_type validation, not covered
Padrão
const HASH_TYPES = Object.freeze(["data", "type", "data1", "data2"]);Tirado do commit, encurtado.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- toastmanAu/daowow:
apps/web/test/manifest.test.js
- Conceitos
- Cell deps and script lookup, Data encoding (molecule, hex, bigints)
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-09-18
- Última mudança
- 2026-09-18
- Ú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-09-18 · toastmanAu/daowow · mais deste projeto
Mais sobre Other
- Recognizing a Nervos DAO deposit cell (not a withdrawing one)
- Hand-encoding WitnessArgs in molecule
- Nervos DAO phase-one withdrawal layout
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Restrict script hashType to data, type, data1, data2 when loading config", CKB lessons, https://pulse.lusocryptolabs.com/learned/other/restrict-script-hashtype-to-data-type-data1-data2-when-loadi, CC BY 4.0, last changed 2026-09-18.