nestjs-ethers icon indicating copy to clipboard operation
nestjs-ethers copied to clipboard

Exception when using MUMBAI_NETWORK

Open vanb opened this issue 1 year ago • 2 comments

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

When setting most of the networks constants in config options, the module connects just fine. Except when using MUMBAI_NETWORK I receive this error.

[Nest] 64120  - 08/04/2022, 4:12:18 PM   ERROR [ExceptionHandler] unsupported getDefaultProvider network (operation="getDefaultProvider", network={"name":"maticmum","chainId":80001,"ensAddress":null,"_defaultProvider":null}, code=NETWORK_ERROR, version=providers/5.6.8)

Expected behavior

I expect the module to connect to Polygon Mumbai. All other tested network constants did not throw an error.

Minimal reproduction of the problem with instructions

EthersModule.forRoot({
  network: MUMBAI_NETWORK,
}),

What is the motivation / use case for changing the behavior?

Environment


Nest version: ^8.0.0
Nest Ethers version: ^1.0.3

 
For Tooling issues:
- Node version: v16.14.2  
- Platform: Mac 
- Server: Express 

Others:

I get a similar error for setting network to `http://localhost:8545` as described in options docs, when trying to connect to local hardhat node. `npm hardhat node`

`[Nest] 70323  - 08/04/2022, 5:28:08 PM   ERROR [ExceptionHandler] Invalid network http://localhost:8545.`

vanb avatar Aug 04 '22 20:08 vanb

@vanb. I will take a look.

0xslipk avatar Aug 16 '22 21:08 0xslipk

I believe I was able to resolve this by setting use default provider to false and setting an alchemy key. If that's required then perhaps I missed it in the docs.

vanb avatar Aug 17 '22 11:08 vanb

Prefect. I will close this issue for now

0xslipk avatar Oct 31 '22 14:10 0xslipk