diff options
Diffstat (limited to 'ui/app/ducks')
-rw-r--r-- | ui/app/ducks/gas/gas-duck.test.js | 12 | ||||
-rw-r--r-- | ui/app/ducks/gas/gas.duck.js | 11 |
2 files changed, 19 insertions, 4 deletions
diff --git a/ui/app/ducks/gas/gas-duck.test.js b/ui/app/ducks/gas/gas-duck.test.js index 4e875e020..c0152c74f 100644 --- a/ui/app/ducks/gas/gas-duck.test.js +++ b/ui/app/ducks/gas/gas-duck.test.js @@ -364,7 +364,9 @@ describe('Gas Duck', () => { {}, initState, { basicPriceAndTimeEstimatesLastRetrieved: 1000000 } - ) })) + ), + metamask: { provider: { type: 'ropsten' } }, + })) assert.deepEqual( mockDistpatch.getCall(0).args, [{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED} ] @@ -428,7 +430,9 @@ describe('Gas Duck', () => { {}, initState, { priceAndTimeEstimatesLastRetrieved: 1000000 } - ) })) + ), + metamask: { provider: { type: 'ropsten' } }, + })) assert.deepEqual( mockDistpatch.getCall(0).args, [{ type: GAS_ESTIMATE_LOADING_STARTED} ] @@ -479,7 +483,9 @@ describe('Gas Duck', () => { gasprice: 50, }], } - ) })) + ), + metamask: { provider: { type: 'ropsten' } }, + })) assert.deepEqual( mockDistpatch.getCall(0).args, [{ type: GAS_ESTIMATE_LOADING_STARTED} ] diff --git a/ui/app/ducks/gas/gas.duck.js b/ui/app/ducks/gas/gas.duck.js index 0a571a78e..8eb68f846 100644 --- a/ui/app/ducks/gas/gas.duck.js +++ b/ui/app/ducks/gas/gas.duck.js @@ -7,6 +7,9 @@ import { import { decGWEIToHexWEI, } from '../../helpers/utils/conversions.util' +import { + isEthereumNetwork, +} from '../../selectors/selectors' // Actions const BASIC_GAS_ESTIMATE_LOADING_FINISHED = 'metamask/gas/BASIC_GAS_ESTIMATE_LOADING_FINISHED' @@ -356,10 +359,16 @@ function inliersByIQR (data, prop) { export function fetchGasEstimates (blockTime) { return (dispatch, getState) => { + const state = getState() + + if (isEthereumNetwork(state)) { + return Promise.resolve(null) + } + const { priceAndTimeEstimatesLastRetrieved, priceAndTimeEstimates, - } = getState().gas + } = state.gas const timeLastRetrieved = priceAndTimeEstimatesLastRetrieved || loadLocalStorageData('GAS_API_ESTIMATES_LAST_RETRIEVED') || 0 dispatch(gasEstimatesLoadingStarted()) |