push
github
Merge bitcoindevkit/rust-esplora-client#98: Implement retryable calls <a class=hub.com/bitcoindevkit/rust-esplora-client/commit/<a class="double-link" href="https://git"><a class=hub.com/bitcoindevkit/rust-esplora-client/commit/b96270e2993377f121fccdbf117676830f059049">b96270e29 feat(async,blocking)!: implement retryable calls (valued mammal) Pull request description: Based on #93 the PR implements retryable calls for request failure due to too many requests (429) or service unavailable (503). Inspired by #71 h/t @e1a0a0ea ### Notes I've added the field `max_retries` to the `Builder`. `max_retries` is also added to each of `AsyncClient`, `BlockingClient`. I added the dependency `async-std` in order to have async `sleep`. Instead of implementing a trait on the `Request` type as in #71, the approach is to add a method on the client that sends a get request to a url and returns the response after allowing for retries. I tested on the bdk `wallet_esplora_*` example crates against https://blockstream.info/testnet/api and it seemed to resolve the 429 issue. ACKs for top commit: oleonardolima: ACK b96270e2993377f121fccdbf117676830f059049 notmandatory: tACK b96270e2993377f121fccdbf117676830f059049 Tree-SHA512: 781241069ac434ba7147ed27563090a6682
36 of 59 new or added lines in 3 files covered. (61.02%)
2 existing lines in 1 file now uncovered.1041 of 1182 relevant lines covered (88.07%)
9.91 hits per line