1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/development/states
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
..
account-detail-with-shapeshift-tx.json
account-detail-with-transaction-history.json
account-detail.json
account-list-with-imported.json
accounts-loose.json
accounts.json
add-token.json Prevent send to token warning (#6058) 2019-01-23 14:39:56 -03:30
compilation-bug.json
conf-tx.json New settings custom rpc form (#6490) 2019-05-09 14:57:14 -02:30
config.json
confirm-new-ui.json Check for invalid gas estimates from local storage (#6800) 2019-07-04 16:18:12 -03:00
confirm-sig-requests.json Check for invalid gas estimates from local storage (#6800) 2019-07-04 16:18:12 -03:00
create-vault-password.json
currency-localization.json Check for invalid gas estimates from local storage (#6800) 2019-07-04 16:18:12 -03:00
custom-rpc.json
empty-account-detail.json
first-time.json Add support for RPC endpoints with custom chain IDs (#5134) 2018-10-26 10:26:43 +02:00
help.json
import-private-key-warning.json
import-private-key.json
locked.json
lost-accounts.json
navigate-txs.json feature: add Goerli support (#6459) 2019-04-17 15:04:49 -02:30
new-account.json
new-vault.json
notice.json notices - replace getLatestNotice with getNextNotice 2018-06-13 23:30:31 -07:00
pending-crash.json
pending-signature.json
pending-tx-insufficient.json
pending-tx.json feature: add Goerli support (#6459) 2019-04-17 15:04:49 -02:30
personal-sign.json
private-key-export-success.json
private-key-export.json
private-network.json
restore-vault.json
send-edit.json Check for invalid gas estimates from local storage (#6800) 2019-07-04 16:18:12 -03:00
send-new-ui.json Check for invalid gas estimates from local storage (#6800) 2019-07-04 16:18:12 -03:00
send.json New settings custom rpc form (#6490) 2019-05-09 14:57:14 -02:30
shapeshift.json
show-seed-words.json
terms-and-conditions.json
tx-list-items.json Check for invalid gas estimates from local storage (#6800) 2019-07-04 16:18:12 -03:00