Fix the localhost:8545 error in dashboard.
kamikazebr opened this issue ยท 7 comments
I believe it might be related to these lines: https://github.com/1Hive/celeste-dashboard/blob/master/src/lib/web3-utils.js#L27-L32
export function getDefaultProvider(chainId = getPreferredChain()) {
const type = getNetworkType(chainId)
const defaultEthNode = getDefaultEthNode(chainId)
return defaultEthNode
? new Providers.StaticJsonRpcProvider(defaultEthNode)
: ethers.getDefaultProvider(type, getBackendServicesKeys())
}
In particular, every time we are using getDefaultProvider
we have to double-check if we are providing the right chainId
. Let's review the getPreferredChain
, getNetworkType
, and getDefaultEthNode
are working fine.
Also, @fabriziovigevani might have a better understanding here.
I believe it might be related to these lines: https://github.com/1Hive/celeste-dashboard/blob/master/src/lib/web3-utils.js#L27-L32
export function getDefaultProvider(chainId = getPreferredChain()) { const type = getNetworkType(chainId) const defaultEthNode = getDefaultEthNode(chainId) return defaultEthNode ? new Providers.StaticJsonRpcProvider(defaultEthNode) : ethers.getDefaultProvider(type, getBackendServicesKeys()) }
In particular, every time we are using
getDefaultProvider
we have to double-check if we are providing the rightchainId
. Let's review thegetPreferredChain
,getNetworkType
, andgetDefaultEthNode
are working fine.
Yes. I got to them. I think good way its write small unit test to ensure it works properly.
The PR need be reviewed #155