1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 02:58:09 +01:00
metamask-extension/ui/app
Mark Stacey ec40b2a325
Check for invalid gas estimates from local storage (#6800)
* Remove unused state 'gas.basicPriceAndTimeEstimates'

* Check for invalid estimates from local storage

Gas estimates were being cached in local storage then later retrieved,
but the retrieved values were not being checked. If the data failed to
save, failed to load, or was cleared since being saved, it would result
in the gas estimates being set to undefined.

The estimates retrieved from local storage are now checked before they
are used. If they are falsy, the estimates are retrieved from the
network instead.

This should fix this Sentry issue:
[METAMASK-6W0T](https://sentry.io/share/issue/cfe470314a5741768b19050815322aa4/)

A few additional changes were made to the gas-duck tests to accommodate
the use of `sinon.restore`. `restore` is strongly recommended by the
`sinon` team, as neglecting to use it can result in memory leaks. It has
the additional benefit of ensuring you create fresh stubs/spies for each
test, which means they no longer need to be reset between tests.
2019-07-04 16:18:12 -03:00
..
components Remove UiMigrationAnnouncement and associated state (#6794) 2019-07-04 12:21:21 -02:30
css Fix styles on 'import account' page, update help link (#6700) 2019-06-17 08:37:34 -02:30
ducks Check for invalid gas estimates from local storage (#6800) 2019-07-04 16:18:12 -03:00
helpers Fixes display of confirm screen token decimals by not relying on confirmTransaction state. 2019-06-28 01:51:33 -03:00
pages Remove UiMigrationAnnouncement and associated state (#6794) 2019-07-04 12:21:21 -02:30
selectors 4byte fallback (#6551) 2019-06-18 09:47:14 -02:30
store Remove UiMigrationAnnouncement and associated state (#6794) 2019-07-04 12:21:21 -02:30