v1.32.2: el texto del cambio cuenta las pistas que se ven
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5npnUYgSPkAaHkdaeUqBr
This commit is contained in:
+19
-1
@@ -24,7 +24,7 @@ const E = new Function(`const C = { green:"g", amber:"a", red:"r", t2:"t", blue:
|
||||
${cut("const ENTITY_INDEX = new Map([", "// ── Wallet fingerprinting")}
|
||||
${cut("function detectWallets", "function analyzeAddress")}
|
||||
${cutFn("analyzeAddress")}
|
||||
return { historialOculto, analyzeAddress };`);
|
||||
return { historialOculto, analyzeAddress, analyzeTx };`);
|
||||
let F;
|
||||
try { F = E(); } catch (e) { console.error("No se pudo cargar:", e.message); process.exit(1); }
|
||||
let pass = 0, fail = 0;
|
||||
@@ -46,5 +46,23 @@ ok("y lo explica con un aviso propio", a.checks.some(c => c.id === "historial_oc
|
||||
const u = F.analyzeAddress({ ...st(0, 0), txs: [], utxos: [] });
|
||||
ok("una sin usar de verdad sigue saliendo «sin usar»", u.unused === true && !u.sinHistorial);
|
||||
|
||||
console.log("\n=== Recuento de pistas del cambio ===\n");
|
||||
{
|
||||
// Cambio que vuelve a la dirección que gasta + la otra salida es redonda:
|
||||
// en el dibujo se ven 2 pistas, y el texto tiene que decir 2 (decía 3,
|
||||
// porque la vuelta a la dirección pesa doble en la nota).
|
||||
const A = "bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu", B = "bc1qnjg0jd8228aq7egyzacy8cys3knf9xvrerkf9g";
|
||||
const spk = "0014" + "11".repeat(20);
|
||||
const tx = { txid: "ab".repeat(32), version: 2, locktime: 0, fee: 743, weight: 561, size: 222,
|
||||
status: { confirmed: true, block_height: 900000 },
|
||||
vin: [{ txid: "cd".repeat(32), vout: 0, sequence: 0xfffffffd, witness: ["30", "02"],
|
||||
prevout: { scriptpubkey: spk, scriptpubkey_type: "v0_p2wpkh", scriptpubkey_address: A, value: 50000000 } }],
|
||||
vout: [{ scriptpubkey: spk, scriptpubkey_type: "v0_p2wpkh", scriptpubkey_address: A, value: 29999257 },
|
||||
{ scriptpubkey: "0014" + "22".repeat(20), scriptpubkey_type: "v0_p2wpkh", scriptpubkey_address: B, value: 20000000 }] };
|
||||
const r = F.analyzeTx(tx);
|
||||
const c = r.checks.find(x => x.id === "change_detection");
|
||||
ok("vuelta a la dirección + cifra redonda → «2 señales apuntan»", c && /2 señales apuntan/.test(c.detail), c && c.detail.slice(0, 90));
|
||||
}
|
||||
|
||||
console.log(`\n${pass} correctas, ${fail} fallidas`);
|
||||
process.exit(fail ? 1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user