-
Notifications
You must be signed in to change notification settings - Fork 114
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
Initial attempt to make Source generic over JsonRpcClient #68
Conversation
51c78cd
to
077a64d
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.
This should work by refactoring struct Fetcher
to be generic over M: Middleware
, and have that propagate to Source
, instead of generalizing over the transport
I see yeah - that makes sense, just went through the
Trying to understand how to get it such that we don't have to generalize
|
Define |
yeah you're right that doing what you mentioned would make
quoted from the below link on workarounds:
which aligns with the error I pasted above:
because the corresponding trait functions would need to be defined as such (IIUC):
there seem to be some workarounds, including using an Also - if im misunderstanding the pasted compiler error/the link above, let me know. I could be wrong in how I understand the error. |
going to close this out for now dont want to leave a stale PR draft hanging, not sure how to work around what I mentioned above without reworking either the Dataset trait or making Source accept an enum Fetcher/Provider, which would significantly change the code (matches everywhere). Im also not sure adding WS is a super critical feature, since cryo functions fine as is, so I dont think restructuring the code is worth it here. |
Draft PR for #65 attempting to make Source generic over
impl ethers::providers::JsonRpcClient
to allow for both a Ws and HttpProviderThis currently doesn't compile because the current implementation route makes the
Dataset
trait non-object safe!any pointers/corrections or simplifications here or via another PR welcome! I'm happy to close this out, wanted to take a stab at seeing how this would look