ExchangeUnion / xud

Exchange Union Daemon 🔁 ⚡️
https://exchangeunion.com
GNU Affero General Public License v3.0
115 stars 44 forks source link

fix(connext): fix ethprovider network name #2058

Closed ghost closed 3 years ago

ghost commented 3 years ago

This PR ensures that we pass in rinkeby as the network name when running in testnet mode. Otherwise ethers.providers.JsonRpcProvider would fail to initialize.

Can be tested using https://github.com/ExchangeUnion/xud-docker/pull/819

ghost commented 3 years ago

Why is setting the chain id and network name required in the first place? If it does not work without that, it indicates that the connext endpoint is missing some information. Ethers should fetch that data on its own automatically

It seems to be a required type for Network:

export declare type Network = {
    name: string;
    chainId: number;
    ensAddress?: string;
    _defaultProvider?: (providers: any, options?: any) => any;
};
michael1011 commented 3 years ago

It seems to be a required type for Network:

Yeah but why do you set the network in the first place? In my experience, ethers fetches the values it needs automatically.

ghost commented 3 years ago

It seems to be a required type for Network:

Yeah but why do you set the network in the first place? In my experience, ethers fetches the values it needs automatically.

You're right. Removed it and it still works. Thanks.