mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-25 20:02:58 +01:00
c044b6f2b4
* 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 |
||
---|---|---|
.. | ||
data | ||
e2e | ||
lib | ||
stub | ||
unit | ||
unit-global | ||
env.js | ||
helper.js | ||
setup.js |