-
Notifications
You must be signed in to change notification settings - Fork 213
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
feature: ProviderCall #788
Conversation
b465c20
to
b1496cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense,
this is still easy to follow imo
b1496cb
to
21b11f1
Compare
fix: rename to prov_call for disambiguation
068c2e4
to
f14aa77
Compare
the main problem right now is figuring out how to integrate it into |
hey @prestwich Taking this over, need it for #954 |
Would appreciate it if you have any pointers on how to move forward from here. I think only integrating |
* use `ClientRef` in EthCall instead of `WeakClient` * change lifetimes * add *_internal methods that return `EthCall`
This reverts commit 569d168.
I think we can now unify |
|
@yash-atreya one thing I find a bit confusing here is that by design of I think one valid usecase for this PR is for example changing I think what we want for |
…1159) * feat: RpcCall:map_params * WithBlockInner * Ready variant * fmt * use ProviderCall * clippy + fmt * add From<F> * make ProviderCall::Ready return a result * add docs * Update request.rs Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com> * fmt --------- Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
@mattsse I believe this can be merged now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should work now,
mind giving this another close look @klkvr ?
@yash-atreya wondering how do we decide which |
Sorry for the delayed response.
I believe subscribe/watch methods should be Also, any RPC method where we accept a parameter by reference, should be Rest can be made to return Should extension traits such as @mattsse wdyt? |
Lifetimes should be fine, we already have them in e.g.
We are already using |
We want to avoid introducing lifetimes in the trait as much as possible,
+1 |
use std::borrow::Cow; | ||
|
||
/// A caller that helper convert `RpcWithBlock` and `EthCall` into a `ProviderCall`. | ||
pub trait Caller<T, Params, Resp>: Send + Sync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given we're now wonly using this for EthCall
, I think we should make it more call-specific, eg make it accept TransactionRequest
, block and overrides directly to allow implementations to directly call underlying evm with them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm overall, just a note on Caller
trait, we can address this in a follow-up
Closes #736
Motivation
Allow providers to get outputs from arbitrary sources, including synchronous
Solution
ProviderCall
future that wraps 4 data sources (rpc, batch rpc, other future, ready)drive-by:
into_owned_params
PR Checklist