test(verify): cover a confirmed status without a block hash or height
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 25/100
Direzione di ricerca
Read tests/test_verify.py and inspect _api(status=...) to see how status responses are mocked. Add cases for confirmed statuses missing block_hash and block_height, asserting MempoolAPIError with the specified messages and ensuring neither case raises VerificationError. Run the test suite using the commands in CONTRIBUTING.md; done means both cases pass without changing files under btc_toolkit/.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What
The API is untrusted, and verify_tx checks its answers. A /tx/<txid>/status that says the transaction is confirmed must also give the block hash and the block height (verify.py L214-L219). Neither case has a test.
What to do
Add tests to tests/test_verify.py for a confirmed status without block_hash, and for one without block_height. Both must raise MempoolAPIError (an API error, exit code 1), never a VerificationError and never a traceback. All API calls are mocked; the suite runs offline.
Acceptance
- The
block_heighttest fails if the check at L218-L219 is removed (without it, the missing height ends in aVerificationErrorabout a different block height). A missingblock_hashis already refused earlier, byfield_hashat L216 ("'block_hash' is missing"); its test locks that in. - No change under
btc_toolkit/.
Hints
_api(status=...)intests/test_verify.pylets you choose the status response.VerificationErroris a subclass ofMempoolAPIError, soassertRaises(MempoolAPIError)alone also passes on aVerificationError. Match the message (assertRaisesRegex(MempoolAPIError, "confirmed without"),"'block_hash' is missing") or assert that the exception is not aVerificationError.
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
-
api: reject a /tx response that has no txid fieldForse già presa @pkray2012 l’ha presa 1 giorno fa. Apertaenhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
devdavidejesus/btc-toolkit#103 ·
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