You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a means of more deeply understanding what the incoming transaction controller does I set out to document its methods with types and descriptions. In so doing I found a number of cases where I felt like the readability of the controller could be improved. This should be a non-functional refactor. Please take care in reading the changes to the test file to see if I have altered the desired outcomes in any functional way.
This will require a migration as I renamed incomingTxLastFetchedBlocksByNetwork to incomingTxLastFetchedBlockByChainId. Although the value is an object storing values that are blocks, each chainId only has one block. Although I've changed it from network to chainId, this shouldn't result in functional changes except where user's are using custom networks with chainIds that match default chains.
Migration now included, and the case above doesn't exist because we were mapping chainId to provider type before, so custom network with chainId 0x1 would have had its last fetched block stored in the mainnet key
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
Although I've changed it from network to chainId, this shouldn't result in functional changes except where user's are using custom networks with chainIds that match default chains.
I think even for those users it won't be a functional change, as we were using the chainId and mapping it back to a type (using CHAIN_ID_TO_NETWORK_ID_MAP). So it was effectively grouping by chainId already, even though it was keyed by the network identifier. Unless I missed something.
I think even for those users it won't be a functional change, as we were using the chainId and mapping it back to a type (using CHAIN_ID_TO_NETWORK_ID_MAP). So it was effectively grouping by chainId already, even though it was keyed by the network identifier. Unless I missed something.
No, that's correct. This should be an entirely non-functional change.
@Gudahtt thanks for review and approval! I'm going to hold this and change my migration number to avoid stealing two migration numbers from @darkwing 😬. going to bump the number up by one and wait for #10593 to land.,
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 freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
3 participants
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.
Rationale
As a means of more deeply understanding what the incoming transaction controller does I set out to document its methods with types and descriptions. In so doing I found a number of cases where I felt like the readability of the controller could be improved. This should be a non-functional refactor. Please take care in reading the changes to the test file to see if I have altered the desired outcomes in any functional way.
This will require a migration as I renamedincomingTxLastFetchedBlocksByNetworktoincomingTxLastFetchedBlockByChainId. Although the value is an object storing values that are blocks, eachchainIdonly has one block. Although I've changed it fromnetworktochainId, this shouldn't result in functional changes except where user's are using custom networks withchainIdsthat match default chains.Migration now included, and the case above doesn't exist because we were mapping chainId to provider type before, so custom network with chainId
0x1would have had its last fetched block stored in themainnetkey