diff options
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', }, |