Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Ganache's provider type is not compatible with Web3 #2125

@davidmurdoch

Description

@davidmurdoch

it's a matter of
(payload: JsonRpcRequest<...>, callback?: Callback | undefined)
(the relevant part of the type on Ganache)
vs
(payload: JsonRPCRequest, callback: Callback<JsonRPCResponse>)

Full error:

    test/encoder.test.ts:76:50 - error TS2345: Argument of type 'EthereumProvider_2' is not assignable to parameter of type 'Provider'.
      Types of property 'send' are incompatible.
        Type '{ <Method extends never>(method: Method, params?: NoUnknownArray<Parameters<Overloads<EthereumApi[Method]>>> | undefined): cleanAndMergePromiseGenerics<...>; <Method extends never>(payload: JsonRpcRequest<...>, callback?: Callback | undefined): undefined; <Method extends never>(payloads: JsonRpcRequest<...>[], callb...' is not assignable to type '(payload: JsonRPCRequest, callback: Callback<JsonRPCResponse>) => any'.
          Types of parameters 'params' and 'callback' are incompatible.
            Type 'Callback<JsonRPCResponse>' is not assignable to type 'undefined'.
            ```

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions