diff --git a/site/api/faucet.mjs b/site/api/faucet.mjs index a92243a8e..7ee001437 100644 --- a/site/api/faucet.mjs +++ b/site/api/faucet.mjs @@ -59,7 +59,7 @@ export function createHandler({ env = process.env, sql, rpc } = {}) { const key = env.FAUCET_KEY, rpcUrl = env.FAUCET_RPC; const chainId = Number(env.FAUCET_CHAIN_ID || 4463); if (!key || !/^0x[0-9a-fA-F]{64}$/.test(key) || !rpcUrl) { - return res.status(503).json({ ok: false, error: 'The faucet is not open yet. It opens with the public testnet.' }); + return res.status(503).json({ ok: false, error: 'The faucet is not open yet.' }); } let body; try { body = await readBody(req); } catch { return res.status(400).json({ ok: false, error: 'bad json' }); } diff --git a/site/lc/app.js b/site/lc/app.js index 10f66b247..1f4b7cdc3 100644 --- a/site/lc/app.js +++ b/site/lc/app.js @@ -6,7 +6,7 @@ import { blake2b } from 'https://cdn.jsdelivr.net/npm/@noble/hashes@2.4.0/blake2.js/+esm'; import { keccak_256 } from 'https://cdn.jsdelivr.net/npm/@noble/hashes@2.4.0/sha3.js/+esm'; import { bls12_381 } from 'https://cdn.jsdelivr.net/npm/@noble/curves@2.4.0/bls12-381.js/+esm'; -import { verifyBalance, verifyReceipt, verifyPaymentReceipt, formatIgn } from './core.js'; +import { verifyBalance, verifyReceipt, formatIgn } from './core.js'; export const LIBRARIES = { '@noble/hashes': '2.4.0', '@noble/curves': '2.4.0' }; const deps = { blake2b, bls: bls12_381, keccak: keccak_256 }; @@ -76,28 +76,24 @@ export async function runReceipt(tx) { await new Promise(resolve => setTimeout(resolve, 20)); const bad = clone(receipt); bad.raw_tx_hex = flipHex(bad.raw_tx_hex, 40); const neg = verifyReceipt(bad, deps); - const res = verifyPaymentReceipt(receipt, deps); - if (res.payment) { receipt.kind = 'payment receipt'; receipt.authenticates = 'inclusion of the signed transaction in a finalised block and its successful execution outcome (status and logs) through the proven segment\'s receipts commitment'; } - let negPay = null; - if (res.payment) { const b2 = clone(receipt); const r0 = b2.segment.receipts[Number(b2.segment.receipt_position)]; r0.status = '0x0'; negPay = verifyPaymentReceipt(b2, deps); } + const res = verifyReceipt(receipt, deps); window.__igneumReceipt = { receipt, neg, res }; const t = res.tx || {}; const when = new Date(Number(res.block_time || 0)).toISOString().replace('T', ' ').slice(0, 19) + ' UTC'; const top = res.verified - ? `
Outcome authenticated: ${esc(res.outcome.asset)}, ${esc(formatIgn(res.outcome.amount_wei))} IGN to ${esc(res.outcome.recipient || 'contract creation')}, executed with status success, through the receipts commitment of the proven segment ending at chain block ${esc(String(receipt.execution.chain_block))}.
` : `This is the inclusion receipt. ${esc(res.payment_unavailable || receipt.payment_unavailable || 'the outcome is not authenticated')}${res.receipt_status === 'failed' ? ' The authenticated status is FAILED: no transfer took place.' : ''}
`} + ? `${esc(res.reason)}
The file carries the raw transaction, the including block's header and merkle path, every header up to the certified checkpoint, the certificate and the voter table. Anyone re-verifies it offline with the one-file verifier: node verify-receipt.js receipt.json (verify-receipt.js, plain JavaScript, no npm, no network). A tampered file fails there the same way the copy above failed here.
Each row runs site/lc/core.js on live Devnet 3 data from . A tampered case must read refused; the genuine case must read verified. The same cases run under Node in tools/reference-apps/light-service/verify.test.mjs. Parameters: ?api= (the read service), ?address= (the balance to prove; default: the miner of the latest block), ?tx= (a transaction; default: one in a recent block).
Each row runs site/lc/core.js on live devnet data from . A tampered case must read refused; the genuine case must read verified. The same cases run under Node in tools/reference-apps/light-service/verify.test.mjs. Parameters: ?api= (the read service), ?address= (the balance to prove; default: the miner of the latest block), ?tx= (a transaction; default: one in a recent block).
| case | result | ms | reason |