Ethers.js: getDefaultProvider method don't override network configuration

Created on 15 Jul 2020  路  4Comments  路  Source: ethers-io/ethers.js

We are using ethers to initialize our provider using getDefaultProvider method. We pass a custom network object with the following structure, using a custom ensAddress:

const network = {
      chainId: 4,
      ensAddress: '0x98df287b6c145399aaa709692c8d308357bc085d',
      name: 'rinkeby',
}

Regardless after calling the method like: ethers.getDefaultProvider(network) we still have the provider initialized with the default values:

{
  chainId:4
  ensAddress:'0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e'
  name:'rinkeby'
}

Here is the logic where we are handling this on our project: link.

Note: This is working fine if we use another kind of provider (e.g. WebSocket)

bug fixed

All 4 comments

I think I may know the issue. I'll look into this shortly.

This should be fixed in v5.0.6. Try it out and let me know if you still have any issues. :)

It seems to be working fine now, thanks @ricmoo! :pray:

Awesome! I鈥檒l close this then.

Thanks! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jochenonline picture jochenonline  路  3Comments

ricmoo picture ricmoo  路  3Comments

moshebeeri picture moshebeeri  路  3Comments

zemse picture zemse  路  3Comments

PhABC picture PhABC  路  3Comments