-
Notifications
You must be signed in to change notification settings - Fork 392
feat(provider
): apply GetSubscription
to trait
#2220
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
feat(provider
): apply GetSubscription
to trait
#2220
Conversation
@mattsse @yash-atreya |
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.
ty, some suggestions
fn subscribe_pending_transactions(&self) -> GetSubscription<(&'static str,), B256, N> { | ||
GetSubscription::new(self.root(), "eth_subscribe", Some(("newPendingTransactions",))) |
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.
we can replace the string with
alloy/crates/rpc-types-eth/src/pubsub.rs
Line 76 in ee7a19b
pub enum SubscriptionKind { |
crates/provider/src/ext/admin.rs
Outdated
&self, | ||
) -> TransportResult<alloy_pubsub::Subscription<alloy_rpc_types_admin::PeerEvent>>; | ||
fn subscribe_peer_events(&self) -> GetSubscription<(), alloy_rpc_types_admin::PeerEvent, N>; |
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 believe we can get rid of the N generic if we use WeakClient instead of the RootProvider in the GetSubscription type
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.
Addressed in #2219
@yash-atreya I believe #2219 does the weakclient change, should we get this one in first? |
Yes we can get this one in and I can rebase #2219 |
@yash-atreya I like the weak client change to drop the network generic and passing just the Rpc Call directly. I think we can merge #2219 in and I follow that to upgrade other subscription functions. Seeing that if this gets merged, there'd still be clean up which can be avoided if that gets merged first. Wdyt? |
Hey @frankudoags, #2219 was merged. Please rebase your PR and let me know if you need any help. Thanks! |
… trait and refractor affected areas
3c16bdf
to
454b6da
Compare
having some issues @yash-atreya
expected |
our call method inside GetSubscription is |
All done now, @yash-atreya , ptal |
provider
): apply GetSubscription
to trait
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.
send it!
thank you all @mattsse @yash-atreya @DaniPopes |
Motivation
Follow up on #2203
Use
GetSubscription
type for subscription functions in Provider trait and refractor affected areasSolution
PR Checklist