1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
metamask-extension/test/unit
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
..
actions [RFC] add prettier to eslint (#8595) 2020-11-02 17:41:28 -06:00
app Alternative savings fix (#9675) 2020-11-09 13:39:38 -03:30
lib Fix import/order issues (#9239) 2020-08-18 16:48:25 -02:30
migrations expand transaction constants coverage (#9790) 2020-11-07 01:38:12 -06:00
responsive/components [RFC] add prettier to eslint (#8595) 2020-11-02 17:41:28 -06:00
ui expand transaction constants coverage (#9790) 2020-11-07 01:38:12 -06:00
balance-formatter-test.js Migrate codebase to use ESM (#7730) 2020-01-09 00:04:58 -03:30
localhostState.js [RFC] add prettier to eslint (#8595) 2020-11-02 17:41:28 -06:00