Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade TokenDetectionController to extend BaseControllerV2, StaticIntervalPollingController #3609

Merged

Commits on Dec 11, 2023

  1. Define types for BaseControllerV2 migration

    - Add  types`TokenDetectionState`, `TokenDetectionControllerGetStateAction`, `TokenDetectionControllerActions`, `TokenDetectionControllerStateChangeEvent`, `TokenDetectionControllerEvents`, `TokenDetectionControllerMessenger`
    MajorLift committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    d595d0f View commit details
    Browse the repository at this point in the history
  2. Upgrade TokenDetectionController to extend from PollingController

    - Remove methods that can be replaced with actions/events
    - Replace references to `this.config` with `this.state`
    - Replace `this.configure()` calls with `this.update()`
    MajorLift committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    56ca692 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    25ae501 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d42cc0f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0a66c50 View commit details
    Browse the repository at this point in the history
  6. Move TokenDetectionConfig properties to private class fields in `To…

    …kenDetectionController`
    MajorLift committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    1b5b635 View commit details
    Browse the repository at this point in the history
  7. Define controllerName, TokenDetectionState as empty object, remov…

    …e `getNetworkState`
    MajorLift committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    94448cd View commit details
    Browse the repository at this point in the history
  8. Fix: unregister internal getState action handler in constructor as …

    …state object is not used
    MajorLift committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    bcfa0a1 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b8dcf32 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a5ef650 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    72b3618 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    2f74472 View commit details
    Browse the repository at this point in the history
  13. Assume that getTokensState never returns undefined

    - Will throw runtime error if `getTokensState` doesn't return valid tokens state:
    ```
     TypeError: Cannot destructure property 'tokens' of '((cov_1sp0cd8ows(...).s[79]++) , __classPrivateFieldGet(...).call(...))' as it is undefined.
    ```
    MajorLift committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    720dc69 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    74f74ba View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    7b3d4e4 View commit details
    Browse the repository at this point in the history
  16. Fix unnecessary await

    MajorLift committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    2bef9b8 View commit details
    Browse the repository at this point in the history
  17. Use new network-controller action/event

    - Replace `NetworkControlerGetNetworkClientByIdAction` with `NetworkCotnrollerGetNetworkConfigurationByNetworkClientId`
    - Use `NetworkControllerNetworkDidChangeEvent`
    MajorLift committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    9c8491a View commit details
    Browse the repository at this point in the history
  18. Fix tests

    MajorLift committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    05ed86b View commit details
    Browse the repository at this point in the history
  19. Move unregisterActionhandler calls for `TokenDetectionController:ge…

    …tState` to before `super` call in constructor
    MajorLift committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    8964e0d View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    26509c1 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    cb2bd08 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2023

  1. Record CHANGELOG entries

    MajorLift committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    9244803 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1274137 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0c0476c View commit details
    Browse the repository at this point in the history
  4. Test fixes

    MajorLift committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    8dc1fcd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    bb43ebb View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fdb70d9 View commit details
    Browse the repository at this point in the history
  7. Fix test

    MajorLift committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    98e8d17 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8ad12b5 View commit details
    Browse the repository at this point in the history
  9. Fix #getCorrectChainId and polygon network test to pull network con…

    …fig for current `chainId` value if `networkClientId` is not provided
    MajorLift committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    5e94d13 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a5ebc52 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a2007f6 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    3532bbc View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    6601dcc View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    322d074 View commit details
    Browse the repository at this point in the history
  15. Update CHANGELOG records

    MajorLift committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    b60ada5 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    599da4d View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    6c22a3a View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2023

  1. Configuration menu
    Copy the full SHA
    a26d568 View commit details
    Browse the repository at this point in the history
  2. Remove unregister action handler call in constructor and define `befo…

    …reEach` for `getBalancesInSingleCall` tests
    MajorLift committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    85e3f10 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e1a061a View commit details
    Browse the repository at this point in the history
  4. Revert "Fix sliceOfTokensToDetect logic to handle arbitrary number …

    …of `tokensToDetect`"
    
    This reverts commit b8dcf32.
    MajorLift committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    b9cbcba View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4322102 View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2023

  1. Configuration menu
    Copy the full SHA
    fb7cbe2 View commit details
    Browse the repository at this point in the history
  2. Fix test so that preferencesStateChangeListener triggers `detectTok…

    …ens` without `.start()` call
    MajorLift committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    5d602a3 View commit details
    Browse the repository at this point in the history
  3. Add #networkClientId class field and update using `seletedNetworkCl…

    …ientId` in `networkDidChange` listener
    MajorLift committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    a41a218 View commit details
    Browse the repository at this point in the history
  4. Update CHANGELOG to reflect 'Revert "Fix sliceOfTokensToDetect logi…

    …c to handle arbitrary number of `tokensToDetect`'
    MajorLift committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    7e52c7c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e7dac31 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    15f8922 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    15ea19c View commit details
    Browse the repository at this point in the history
  8. Revert "Add #networkClientId class field and update using `seletedN…

    …etworkClientId` in `networkDidChange` listener"
    
    This reverts commit a41a218.
    MajorLift committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    3e1416d View commit details
    Browse the repository at this point in the history
  9. Revert "Fix test so that preferencesStateChangeListener triggers `d…

    …etectTokens` without `.start()` call"
    
    This reverts commit 5d602a3.
    MajorLift committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    123aff5 View commit details
    Browse the repository at this point in the history
  10. Fix test so that preferencesStateChangeListener triggers `detectTok…

    …ens` without `.start()` call
    MajorLift committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    7f2e58b View commit details
    Browse the repository at this point in the history
  11. Add #networkClientId class field and update using `seletedNetworkCl…

    …ientId` in `networkDidChange` listener
    
    - add `NetworkControllerFindNetworkClientIdByChainId` as allowed action
    MajorLift committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    d32cdf4 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    9167cac View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    71d9967 View commit details
    Browse the repository at this point in the history
  14. Add #disabled class field to ensure that passive token detection is…

    … blocked by `stop()` call, and only restored by `start(0` call
    MajorLift committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    0dda603 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    c5eec25 View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2023

  1. Configuration menu
    Copy the full SHA
    1337d19 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    41f85a1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8c331fa View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d40247e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    757ab04 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    44e92cb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4b0bda3 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a007d15 View commit details
    Browse the repository at this point in the history
  9. Edit test description

    MajorLift committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    f5e6611 View commit details
    Browse the repository at this point in the history
  10. Update changelog

    MajorLift committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    b2a5af5 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    eadf3ba View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    aa9e3ba View commit details
    Browse the repository at this point in the history
  13. Revert "Fix incorrect package-level export"

    This reverts commit d40247e.
    MajorLift committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    f636e25 View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2023

  1. Configuration menu
    Copy the full SHA
    173168f View commit details
    Browse the repository at this point in the history
  2. Replace chainId with networkClientId in constructor options.

    - Derive `chainId` from `networkClientId` using `#getCorrectChainId` method
    MajorLift committed Dec 16, 2023
    Configuration menu
    Copy the full SHA
    d81c23d View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2023

  1. Configuration menu
    Copy the full SHA
    d9bd4b1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fefc64b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    73eccbf View commit details
    Browse the repository at this point in the history
  4. Add disabled as constructor option and set it to block `#startPolli…

    …ng`, `_executePoll`, `_startPollingByNetworkClientId` calls
    MajorLift committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    5fe7674 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2023

  1. Configuration menu
    Copy the full SHA
    116a227 View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2023

  1. Remove unused comment

    MajorLift committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    acd022f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ee2154d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cfbd787 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    21f9b8c View commit details
    Browse the repository at this point in the history
  5. Revert "[tokens-controller] Add actions getState, `addDetectedToken…

    …s` and event `stateChange`"
    
    This reverts commit 757ab04.
    MajorLift committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    de94761 View commit details
    Browse the repository at this point in the history
  6. test: Apply 'Revert "[tokens-controller] Add actions getState, `add…

    …DetectedTokens` and event `stateChange`"
    MajorLift committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    4b6c1d2 View commit details
    Browse the repository at this point in the history

Commits on Dec 21, 2023

  1. Configuration menu
    Copy the full SHA
    a951492 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    541f8f4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    798bb09 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1552041 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2451982 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6d020bc View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    05cf2bd View commit details
    Browse the repository at this point in the history
  8. Revert "test: remove unnecessary .start() calls"

    This reverts commit 73eccbf.
    MajorLift committed Dec 21, 2023
    Configuration menu
    Copy the full SHA
    d8ced01 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    16e8bad View commit details
    Browse the repository at this point in the history
  10. Update changelog

    MajorLift committed Dec 21, 2023
    Configuration menu
    Copy the full SHA
    f67bead View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    8e1cdf5 View commit details
    Browse the repository at this point in the history