1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 20:39:08 +01:00
metamask-extension/app/scripts
Mark Stacey 1294955d81
Fix swaps when initial network not Mainnet (#9745)
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.
2020-10-28 16:17:32 -02:30
..
account-import-strategies Fix prefer-spread issues (#9203) 2020-08-12 20:42:07 -02:30
controllers Fix swaps when initial network not Mainnet (#9745) 2020-10-28 16:17:32 -02:30
lib remove matomo and route to segment (#9646) 2020-10-26 14:05:57 -05:00
migrations Remove incorrect Migrator comment (#9659) 2020-10-20 11:34:55 -02:30
platforms Update ESLint shared config to v3 (#9274) 2020-08-19 13:57:05 -02:30
background.js Remove localhost provider type (#9551) 2020-10-12 12:05:40 -07:00
chromereload.js
contentscript.js Update ESLint shared config to v3 (#9274) 2020-08-19 13:57:05 -02:30
first-time-state.js Remove localhost provider type (#9551) 2020-10-12 12:05:40 -07:00
inpage.js Update ESLint shared config to v3 (#9274) 2020-08-19 13:57:05 -02:30
metamask-controller.js Fix swaps when initial network not Mainnet (#9745) 2020-10-28 16:17:32 -02:30
phishing-detect.js Fix import/order issues (#9239) 2020-08-18 16:48:25 -02:30
ui.js Update ESLint shared config to v3 (#9274) 2020-08-19 13:57:05 -02:30