1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 04:46:10 +01:00
metamask-extension/test/unit/app/controllers
Dan J Miller c044b6f2b4
Alternative savings fix (#9675)
* Alternative savings fix

* Further required changes to savings fix

* Further fix to savings calculations that properly accounts for metamask fees

* metaMaskFeeInEth property on quotes to decimal string

* Fix swaps controller unit tests

* Improve documentation in swaps controller

* Prevent getMedianEthValueQuote from mutation passed quotes array with .sort() call

* Another fix and refactor to savings calculations in _findTopQuoteAndCalculateSavings

Cleaner structuring of conditionals for setting tokenValueOfQuoteForSorting, ethValueOfQuote and metaMaskFeeInEth in swaps controller

Stop subtracting medianMetaMaskFee from savings, but include it in savings data

Another fix and refactor to savings calculations in _findTopQuoteAndCalculateSavings

* Add and update unit tests for _findTopQuoteAndCalculateSavings

* Improve calculation of overallValueOfQuoteForSorting for case where ETH is the source token

* Clean up getMedianEthValueQuote code, test and comments

* Clean up _findTopQuoteAndCalculateSavings, create test input and expected results helper functions

* Update getMedianEthValueQuote to account for multiple quotes with overall values equal to the median

* Add jsdoc comment for meansOfQuotesFeesAndValue

* Fix jsdoc comment for getMedianEthValueQuote
2020-11-09 13:39:38 -03:30
..
network expand transaction constants coverage (#9790) 2020-11-07 01:38:12 -06:00
permissions [RFC] add prettier to eslint (#8595) 2020-11-02 17:41:28 -06:00
transactions expand transaction constants coverage (#9790) 2020-11-07 01:38:12 -06:00
cached-balances-test.js [RFC] add prettier to eslint (#8595) 2020-11-02 17:41:28 -06:00
detect-tokens-test.js [RFC] add prettier to eslint (#8595) 2020-11-02 17:41:28 -06:00
ens-controller-test.js [RFC] add prettier to eslint (#8595) 2020-11-02 17:41:28 -06:00
incoming-transactions-test.js expand transaction constants coverage (#9790) 2020-11-07 01:38:12 -06:00
metamask-controller-test.js expand transaction constants coverage (#9790) 2020-11-07 01:38:12 -06:00
preferences-controller-test.js [RFC] add prettier to eslint (#8595) 2020-11-02 17:41:28 -06:00
swaps-test.js Alternative savings fix (#9675) 2020-11-09 13:39:38 -03:30
token-rates-controller.js Fix import/order issues (#9239) 2020-08-18 16:48:25 -02:30