mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 20:39:08 +01:00
1294955d81
This is a continuation of #9726, which did not fix the problem described. If the initial network when the extension is started is something other than Mainnet, the swaps controller will never successfully retrieve swap quotes. This is because `ethers` will continue to communicate with whichever network the provider was initially on. We tried fixing this by hard-coding the `chainId` to Mainnet's `chainId` when constructing the Ethers provider, but this did not work. I suspect this failed because the `provider` we pass to `ethers` is not compliant with EIP 1193, as `ethers` doubtless expects it to be. Instead the entire `ethers` provider is now reconstructed each time the network changes. This mirrors the approach we take in some other controllers. |
||
---|---|---|
.. | ||
account-import-strategies | ||
controllers | ||
lib | ||
migrations | ||
platforms | ||
background.js | ||
chromereload.js | ||
contentscript.js | ||
first-time-state.js | ||
inpage.js | ||
metamask-controller.js | ||
phishing-detect.js | ||
ui.js |