MetaMask / providers

An Ethereum Provider that connects over a stream, as injected into websites by MetaMask
MIT License
217 stars 123 forks source link

Use `@metamask/json-rpc-engine` #275

Closed legobeat closed 10 months ago

legobeat commented 10 months ago

This validates if https://github.com/MetaMask/rpc-errors/pull/102 fixes type error in https://github.com/MetaMask/providers/actions/runs/5554034666/job/15044724731.

legobeat commented 10 months ago

This happens regardless of if bumping @metamask/utils or not:

https://github.com/MetaMask/providers/actions/runs/5958076982/job/16161797970 https://github.com/MetaMask/providers/actions/runs/5959652471/job/16165741468?pr=275

Error: src/utils.ts(51,7): error TS2322: Type 'JsonRpcError<JsonRpcRequest<Json[] | Record<string, Json> | undefined>>' is not assignable to type '{ code: number; message: string; data?: Json | undefined; stack?: string | undefined; }'.
  Types of property 'data' are incompatible.
    Type 'JsonRpcRequest<Json[] | Record<string, Json> | undefined>' is not assignable to type 'Json | undefined'.
      Type 'JsonRpcRequest<Json[] | Record<string, Json> | undefined>' is not assignable to type '{ [prop: string]: Json; }'.
        Property 'params' is incompatible with index signature.
          Type 'Json[] | Record<string, Json> | undefined' is not assignable to type 'Json'.
            Type 'undefined' is not assignable to type 'Json'.
Error: Process completed with exit code 2.

Attempt at fix: https://github.com/MetaMask/utils/pull/130 Validation of fix: https://github.com/MetaMask/providers/pull/276

legobeat commented 10 months ago

277