diff options
author | Dan Miller <danjm.com@gmail.com> | 2018-11-28 01:30:41 +0800 |
---|---|---|
committer | Dan Miller <danjm.com@gmail.com> | 2018-12-04 11:36:22 +0800 |
commit | d8e41a6aa5a4c64538063c6dde7afdf77b0e5793 (patch) | |
tree | e03f9f43682cf687d81e93185cd2edcdb57fb0b2 /ui/app/ducks | |
parent | 75d75454374d98bf904b817bc2dd2b81b9e97a9d (diff) | |
download | tangerine-wallet-browser-d8e41a6aa5a4c64538063c6dde7afdf77b0e5793.tar tangerine-wallet-browser-d8e41a6aa5a4c64538063c6dde7afdf77b0e5793.tar.gz tangerine-wallet-browser-d8e41a6aa5a4c64538063c6dde7afdf77b0e5793.tar.bz2 tangerine-wallet-browser-d8e41a6aa5a4c64538063c6dde7afdf77b0e5793.tar.lz tangerine-wallet-browser-d8e41a6aa5a4c64538063c6dde7afdf77b0e5793.tar.xz tangerine-wallet-browser-d8e41a6aa5a4c64538063c6dde7afdf77b0e5793.tar.zst tangerine-wallet-browser-d8e41a6aa5a4c64538063c6dde7afdf77b0e5793.zip |
Final gas customization fixes
Diffstat (limited to 'ui/app/ducks')
-rw-r--r-- | ui/app/ducks/gas.duck.js | 15 | ||||
-rw-r--r-- | ui/app/ducks/tests/gas-duck.test.js | 16 |
2 files changed, 19 insertions, 12 deletions
diff --git a/ui/app/ducks/gas.duck.js b/ui/app/ducks/gas.duck.js index 20a125dbb..8db24cc83 100644 --- a/ui/app/ducks/gas.duck.js +++ b/ui/app/ducks/gas.duck.js @@ -220,18 +220,25 @@ export function fetchBasicGasAndTimeEstimates () { ) .then(r => r.json()) .then(({ - average, + average: averageTimes10, avgWait, block_time: blockTime, blockNum, - fast, - fastest, + fast: fastTimes10, + fastest: fastestTimes10, fastestWait, fastWait, - safeLow, + safeLow: safeLowTimes10, safeLowWait, speed, }) => { + const [average, fast, fastest, safeLow] = [ + averageTimes10, + fastTimes10, + fastestTimes10, + safeLowTimes10, + ].map(price => (new BigNumber(price)).div(10).toNumber()) + const basicEstimates = { average, avgWait, diff --git a/ui/app/ducks/tests/gas-duck.test.js b/ui/app/ducks/tests/gas-duck.test.js index 4783db30c..bf374c7ec 100644 --- a/ui/app/ducks/tests/gas-duck.test.js +++ b/ui/app/ducks/tests/gas-duck.test.js @@ -32,15 +32,15 @@ describe('Gas Duck', () => { let tempFetch let tempDateNow const mockEthGasApiResponse = { - average: 'mockAverage', + average: 20, avgWait: 'mockAvgWait', block_time: 'mockBlock_time', blockNum: 'mockBlockNum', - fast: 'mockFast', - fastest: 'mockFastest', + fast: 30, + fastest: 40, fastestWait: 'mockFastestWait', fastWait: 'mockFastWait', - safeLow: 'mockSafeLow', + safeLow: 10, safeLowWait: 'mockSafeLowWait', speed: 'mockSpeed', } @@ -338,15 +338,15 @@ describe('Gas Duck', () => { [{ type: SET_BASIC_GAS_ESTIMATE_DATA, value: { - average: 'mockAverage', + average: 2, avgWait: 'mockAvgWait', blockTime: 'mockBlock_time', blockNum: 'mockBlockNum', - fast: 'mockFast', - fastest: 'mockFastest', + fast: 3, + fastest: 4, fastestWait: 'mockFastestWait', fastWait: 'mockFastWait', - safeLow: 'mockSafeLow', + safeLow: 1, safeLowWait: 'mockSafeLowWait', speed: 'mockSpeed', }, |