-
Notifications
You must be signed in to change notification settings - Fork 21
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
Need generic type or similar change for VerificationOpts #52
Comments
suggestion: instead of having the opts own a provider, make a trait and capture the provider calls within the trait, and blanket implement the trait over M: Middleware?
|
something like this? I think that would be a very useful pattern, the one hangup after trying this out is managing the generics on |
Mmm I am not verify familiar with the codebase, but it's not really idiomatic to put a generic communication mechanism into an It is idiomatic to put all the async methods onto the object that manages/causes the async computation. This also allows you to avoid Idiomatic version might look like this
|
This does improve the ergonomics of the opts compared to that other solution, I'll raise it. If you'd like pr authorship, we are also happy to review a pr. |
I probably won't be able to get to it for several days. if you have time, you should This is of course, a breaking API change |
In my first pass at upgrading siwe to use ethers 2, I changed siwe to accept an
Arc
. My code worked with this but it changed the api. Prestwich then showed us how to have a contract that took a reference, so I removed theArc
. It compiled with that change, but I didn't test it with my app.The problem now is that my app currently has the provider in an
Arc
. So I can pass either anArc<Provider<Http>>
or a&Provider<Http>
, but VerificationOpts currently wants aProvider<Http>
.So something about VerificationOpts needs to change. I'm not sure the best option.
Maybe change it to take a reference? Maybe use the maybe-owned crate?
We can also use this as a chance to let it accept other connection types instead of just Http (I would like to use IPC for my app, but websockets are also common).
The text was updated successfully, but these errors were encountered: