You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Middleware functions in eth-json-rpc-middleware, eth-json-rpc-engine, eth-json-rpc-infura are "return type-only" generics with implicit generic parameters. This is a discouraged pattern.
Redefining the functions to expose the generic parameters that are implicitly hard-coded into their return type would make them less brittle to future typing updates.
Example error: "JsonRpcMiddleware<unknown, unknown> is not assignable to parameter of type JsonRpcMiddleware<JsonRpcParams, Json>"
MajorLift
changed the title
Improve typing for middleware functions
Fix middleware functions with implicit, return type-only generic parameters
Feb 8, 2024
Uh oh!
There was an error while loading. Please reload this page.
Motivation
eth-json-rpc-middleware
,eth-json-rpc-engine
,eth-json-rpc-infura
are "return type-only" generics with implicit generic parameters. This is a discouraged pattern.JsonRpcMiddleware<unknown, unknown>
is not assignable to parameter of typeJsonRpcMiddleware<JsonRpcParams, Json>
"Tasks
contributor-docs
TypeScript style-guide entryThe text was updated successfully, but these errors were encountered: