-
Notifications
You must be signed in to change notification settings - Fork 910
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
Use RpcResponseTransformer in PubSubSubscriptionPlan #3404
Use RpcResponseTransformer in PubSubSubscriptionPlan #3404
Conversation
|
24fbc91
to
ba341d8
Compare
e3e426b
to
fb9b2ed
Compare
ba341d8
to
2dcffdb
Compare
fb9b2ed
to
24a64f5
Compare
2dcffdb
to
b640c71
Compare
24a64f5
to
58f62b4
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.
@@ -14,7 +14,7 @@ import { RpcSubscriptionsChannel } from './rpc-subscriptions-channel'; | |||
|
|||
type Config<TNotification> = Readonly<{ | |||
channel: RpcSubscriptionsChannel<unknown, RpcNotification<TNotification> | RpcResponseData<RpcSubscriptionId>>; | |||
responseTransformer?: <T>(response: unknown, notificationName: string) => T; |
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.
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.
58f62b4
to
a5545b4
Compare
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |
This PR refactors the definition of a Response Transformer in the RPC Subscriptions architecture from
<T>(response: unknown, notificationName: string) => T;
toRpcResponseTransformer
.That way, both the RPC and RPC Subscriptions architectures use the same interfaces for transforming requests and responses which means we can refactoring helper method like
getDefaultResponseTransformerForSolanaRpcSubscriptions
in a more composable way (using thepipe
function like we did with default RPC Response Transformer).Note: A changeset for this PR is included in #3407.