v1.43.0: salidas, entradas y direcciones se numeran desde 0, como Bitcoin Core, Sparrow y Mempool

«salida i» y «entrada i» con el índice real en pantalla, informes, PSBT y
ayuda (sin «2.ª salida (vout 1)»); nota «se cuentan desde 0» en los
encabezados; «recepción 0» en la wallet; «vout» en el glosario.
tests/test31.js; test8, test11 y test23 ajustadas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5npnUYgSPkAaHkdaeUqBr
This commit is contained in:
2026-10-24 19:43:55 +02:00
co-authored by Claude Opus 5.5
parent 89dad9792e
commit c78dc6f688
21 changed files with 168 additions and 65 deletions
+2 -2
View File
@@ -101,7 +101,7 @@ console.log("\n=== A2. El cambio de un lote no baja la nota de quien cobra ===\n
OUT(5678901,"v1_p2tr","bc1p5"),OUT(678901,"p2sh","36"),OUT(155000000,"v0_p2wpkh","bc1qEXCAMBIO")];
const r = analyzeTx(TX(vin, outs, { weight:2400, fee:6143 }));
const c = check(r, "change_detection");
ok("se sigue informando del cambio del exchange", c.pass === false && /7\.ª salida/.test(c.detail), c.detail.slice(0,120));
ok("se sigue informando del cambio del exchange", c.pass === false && /salida 6\b/.test(c.detail), c.detail.slice(0,120));
ok("...pero no resta: es del pagador, no de quien cobra", c.informational === true);
ok("...y la banda es ALTA, como sin esa coincidencia", r.band === "ALTA", `score = ${r.score}, banda = ${r.band}`);
}
@@ -198,7 +198,7 @@ console.log("\n=== Hechos, formatos y numeración ===\n");
/24/.test(check(r,"rbf").didactic) && !/v0\.12/.test(check(r,"rbf").didactic));
ok("OFAC: Tornado Cash salió de la lista en 2025", /2025/.test(check(r,"entity_ofac").didactic));
ok("el importe redondo se escribe con coma y 8 decimales (0,01000000 BTC)", /0,01000000 BTC/.test(check(r,"round_numbers").detail), check(r,"round_numbers").detail.slice(0,80));
ok("el cambio se numera desde 1 («2.ª salida»)", /2\.ª salida/.test(check(r,"change_detection").detail), check(r,"change_detection").detail.slice(0,80));
ok("el cambio se numera desde 0 («salida 1»), sin ordinales ni «(vout»", /salida 1\b/.test(check(r,"change_detection").detail) && !/\.ª salida|\(vout/.test(check(r,"change_detection").detail), check(r,"change_detection").detail.slice(0,80));
const op = analyzeTx(TX([IN(5000000,"v1_p2tr","bc1pA")],[OUT(4990000,"v1_p2tr","bc1pB"), { ...OPRET, scriptpubkey:"6a0a"+"ab".repeat(10) }]));
ok("OP_RETURN: Ordinals no usa OP_RETURN", !/Ordinals/.test(check(op,"op_return").detail));
const mezcla = analyzeTx(TX([IN(500000,"v0_p2wpkh","bc1qA"), IN(500000,"p2pkh","1B")],[OUT(990000,"v1_p2tr","bc1pX")]));