Fix fetching of swap quotes when initial network was testnet#9726
Merged
Fix fetching of swap quotes when initial network was testnet#9726
Conversation
Member
Author
Collaborator
Builds ready [e69bc75]
Page Load Metrics (428 ± 53 ms)
|
e69bc75 to
05841e5
Compare
Collaborator
Builds ready [05841e5]
Page Load Metrics (416 ± 56 ms)
|
rekmarks
reviewed
Oct 27, 2020
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 the `ethers` provider used by the swaps controller doesn't allow network changes by default - it assumes that the network remains the same as when the provider was initialized. This was fixed by hard-coding Mainnet as the initial chain ID for this `ethers` provider used by the swaps controller. Some adjustments needed to be made to the `provider` stub to allow setting `1` as the network ID and chain ID in unit tests.
05841e5 to
9b97505
Compare
Collaborator
Builds ready [9b97505]
Page Load Metrics (507 ± 71 ms)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 the
ethersprovider used by the swaps controller doesn't allow network changes by default - it assumes that the network remains the same as when the provider was initialized.This was fixed by hard-coding Mainnet as the initial chain ID for this
ethersprovider used by the swaps controller.Some adjustments needed to be made to the
providerstub to allow setting1as the network ID and chain ID in unit tests.Manual testing steps: