api: reject a /tx response that has no txid field
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
Read btc_toolkit/opreturn.py around lines 69–79, then inspect tests/test_opreturn.py and fuzz/fuzz_parsers.py. Add the missing-txid case to the tests, update the fuzzer inputs and add a [Unreleased] entry in CHANGELOG.md. Done means the missing field raises MempoolAPIError and the stated test, lint, type-check and full suite pass; an open linked pull request (#115) indicates work is already underway.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What
fetch_transaction in opreturn.py, which tx, opreturn and inscription all use, checks that the API's answer describes the transaction that was asked for. It only does so when the answer has a txid field: data.get("txid", txid) falls back to the requested txid, so a response with no txid at all is accepted (opreturn.py L69-L79).
Mempool.space and Esplora always include txid, so a missing field means the response is not the one that was asked for. Other modules already read their fields with the helpers in btc_toolkit/api.py, where a field is required unless a default is given.
What to do
- Require the field: a missing
txidraisesMempoolAPIErrorwith "Unexpected response from /tx: ...", like the existing mismatch check (a non-string one is already rejected). - Add a test to
tests/test_opreturn.pyfor a response withouttxid. - In
fuzz/fuzz_parsers.py, set thetxidfield to the requested txid for part of the inputs that are JSON objects: today the fuzzer gets past the check mostly by leavingtxidout (a randomtxidvalue rarely equalsTXID), and after the change it would rarely get past it. - Add a line to
CHANGELOG.mdunder[Unreleased].
Acceptance
- The new test fails on the current
mainand passes with the change. - The full test suite passes; today no other test relies on a missing
txid.
See CONTRIBUTING.md for the test, lint and type-check commands. Comment below before starting, so two people don't take the same issue.
- Lingua principale
- Python
- Stelle
- 2
- Fork
- 1
- Merge medio
- 1h 45m
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di devdavidejesus/btc-toolkit
-
tests: assert which API paths each command requestsForse già presa @omarelshamy25x l’ha presa oggi. Apertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
devdavidejesus/btc-toolkit#107 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
devdavidejesus/btc-toolkit#104 ·
I maintainer di solito rispondono entro 1 giorno
-
test(verify): cover invalid bits, the mainnet and testnet limits, and the strong thresholdForse già presa @omarelshamy25x l’ha presa 1 giorno fa. Apertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
devdavidejesus/btc-toolkit#99 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement help wanted
Difficoltà 3/5 1-2 giorni Idoneità per principianti 71/100
devdavidejesus/btc-toolkit#105 ·
I maintainer di solito rispondono entro 1 giorno
-
cli: Ctrl+C should stop btc-toolkit without a tracebackForse già presa @jay23606 l’ha presa 1 giorno fa. Apertabug good first issue
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
devdavidejesus/btc-toolkit#102 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di devdavidejesus/btc-toolkit
Issue simili
-
[Resource]: SpaicelyApertaresource-submission validation-passed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
hesreallyhim/awesome-claude-code#3875 · 1 commento ·
-
[Bug]: Ajax Pro login issueApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
bvis/aegis-hass#725 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xForse già presa @NimaVaziri l’ha presa oggi. ApertaPytorch
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NVIDIA/TensorRT-LLM#23406 ·
I maintainer di solito rispondono entro 1 giorno