1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 03:36:18 +02:00
metamask-extension/test/unit/app/controllers
Mark Stacey 5b5b67a985
Fix default gas race condition (#8490)
A race condition exists where after adding an unapproved transaction,
it could be mutated and then replaced when the default gas parameters
are set. This happens because the transaction is added to state and
broadcast before the default gas parameters are set, because
calculating the default gas parameters to use takes some time.
Once they've been calculated, the false assumption was made that the
transaction hadn't changed.

The method responsible for setting the default gas now retrieves an
up-to-date copy of `txMeta`, and conditionally sets the defaults only
if they haven't yet been set.

This race condition was introduced in #2962, though that PR also added
a loading screen that avoided this issue by preventing the user from
interacting with the transaction until after the gas had been
estimated. Unfortunately this loading screen was not carried forward to
the new UI.
2020-05-01 12:25:45 -03:00
..
network Remove unnecessary tx meta properties (#8489) 2020-05-01 08:44:05 -03:00
permissions test/unit/permissions - fix promise await timing (#8410) 2020-04-24 15:05:30 -07:00
transactions Fix default gas race condition (#8490) 2020-05-01 12:25:45 -03:00
balance-controller.spec.js Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30
cached-balances-test.js Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30
detect-tokens-test.js Cleanup detect-tokens controller and tests (#8329) 2020-04-13 17:14:42 -03:00
ens-controller-test.js Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30
incoming-transactions-test.js Prevent accidental use of globals (#8340) 2020-04-15 14:23:27 -03:00
infura-controller-test.js Remove unused sinon sandboxes (#8063) 2020-02-17 21:31:09 -04:00
metamask-controller-test.js Fix order of accounts in eth_accounts response (#8342) 2020-04-16 15:20:01 -03:00
preferences-controller-test.js Update PreferencesController tests (#8328) 2020-04-13 17:03:35 -02:30
token-rates-controller.js Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30