-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(api, blocking, async)!: make library generic over any HTTP client #99
base: master
Are you sure you want to change the base?
Conversation
3e0123f
to
017a0cc
Compare
Pull Request Test Coverage Report for Build 10894551662Details
💛 - Coveralls |
017a0cc
to
86863f4
Compare
@evanlinjin, I've started working on this one, on top of what you've suggested if you want to have a look. I'm still thinking of ways to have better ergonomics on its usage, and not have the multiple deserialize_... methods. |
86863f4
to
c3c46e4
Compare
- add new APIs: `TransactionApi`, `AddressesApi`, `BlocksApi` and `FeeEstimatesApi` - add new `trait Client` with minimal HTTP behaviors: `request`, `send` and `deserialize_{decodable|json|str}` methods. - apply new APIs to `BlockingClient`, create new `handler` to build request and send with minreq HTTP client.
async - add new `trait Client` behavior: `send_async`. - apply new APIs to `AsyncClient`, create new `handler` to build request and send with `reqwest` HTTP client.
b6e5e80
to
b41d756
Compare
Thanks for the progress on this! I still need to have a proper look. For now, I'm wondering whether we should just depend on the |
Thanks! Sure, I'll update it to depend on the Agree, it's just a matter of implementing a |
fixes #97
Description
It refactors the library, introducing and adding new structures/enums for Esplora API:
TransactionApi
,AddressesApi
,BlocksApi
, andFeeEstimateApi
.Introduce and exposes new
trait Client
with minimal HTTP behaviors:request
,send
,send_async
, anddeserialize_{decodable|json|str}
methods.Any HTTP client can now implement either the
send
orsend_async
method, use it's inner HTTP client structure for dispatching and handling the request/response, then use the common already implemented methods for deserializing the response.Notes to the reviewers
I still think it's not there yet, the ergonomics and usage can be improved, but I'd like to see if anyone has any comments or suggestions on the approach.
Changelog notice
TBD
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
Bugfixes: