core icon indicating copy to clipboard operation
core copied to clipboard

`json-rpc-engine`: Replace use of `any` with proper types (non-test files only)

Open mcmire opened this issue 1 year ago • 2 comments

Look for the following string in non-test files to find these: // TODO: Replace `any` with type

At time of writing, there were 6 instances.

mcmire avatar Jan 04 '24 22:01 mcmire

  • Completing this ticket will enable us to take full advantage of the type safety improvements that will be introduced by the provider alignment technical proposals.
  • All of the any usages in this package are for typing errors in catch blocks. These errors should mostly be aligned to JsonRpcEngineCallbackError.
  • serializeError() should only be used when sending an error via JSON-RPC. Otherwise, the information in unknown errors thrown by middleware should be preserved.

MajorLift avatar Feb 08 '24 17:02 MajorLift

  • See previous refactor efforts: https://github.com/MetaMask/json-rpc-engine/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc
  • Especially relevant: https://github.com/MetaMask/json-rpc-engine/pull/84

MajorLift avatar Feb 27 '24 17:02 MajorLift