|
|
@ -399,7 +399,7 @@ export function fetchGasEstimates (blockTime) { |
|
|
|
const next = arr[i + 1] |
|
|
|
const next = arr[i + 1] |
|
|
|
if (!next) { |
|
|
|
if (!next) { |
|
|
|
return [{ expectedWait, gasprice }] |
|
|
|
return [{ expectedWait, gasprice }] |
|
|
|
} else { |
|
|
|
} |
|
|
|
const supplementalPrice = getRandomArbitrary(gasprice, next.gasprice) |
|
|
|
const supplementalPrice = getRandomArbitrary(gasprice, next.gasprice) |
|
|
|
const supplementalTime = extrapolateY({ |
|
|
|
const supplementalTime = extrapolateY({ |
|
|
|
higherY: next.expectedWait, |
|
|
|
higherY: next.expectedWait, |
|
|
@ -421,7 +421,6 @@ export function fetchGasEstimates (blockTime) { |
|
|
|
{ expectedWait: supplementalTime, gasprice: supplementalPrice }, |
|
|
|
{ expectedWait: supplementalTime, gasprice: supplementalPrice }, |
|
|
|
{ expectedWait: supplementalTime2, gasprice: supplementalPrice2 }, |
|
|
|
{ expectedWait: supplementalTime2, gasprice: supplementalPrice2 }, |
|
|
|
] |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
})) |
|
|
|
})) |
|
|
|
const withOutliersRemoved = inliersByIQR(withSupplementalTimeEstimates.slice(0).reverse(), 'expectedWait').reverse() |
|
|
|
const withOutliersRemoved = inliersByIQR(withSupplementalTimeEstimates.slice(0).reverse(), 'expectedWait').reverse() |
|
|
|
const timeMappedToSeconds = withOutliersRemoved.map(({ expectedWait, gasprice }) => { |
|
|
|
const timeMappedToSeconds = withOutliersRemoved.map(({ expectedWait, gasprice }) => { |
|
|
@ -453,11 +452,11 @@ export function fetchGasEstimates (blockTime) { |
|
|
|
|
|
|
|
|
|
|
|
export function setCustomGasPriceForRetry (newPrice) { |
|
|
|
export function setCustomGasPriceForRetry (newPrice) { |
|
|
|
return (dispatch) => { |
|
|
|
return (dispatch) => { |
|
|
|
if (newPrice !== '0x0') { |
|
|
|
if (newPrice === '0x0') { |
|
|
|
dispatch(setCustomGasPrice(newPrice)) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
const { fast } = loadLocalStorageData('BASIC_PRICE_ESTIMATES') |
|
|
|
const { fast } = loadLocalStorageData('BASIC_PRICE_ESTIMATES') |
|
|
|
dispatch(setCustomGasPrice(decGWEIToHexWEI(fast))) |
|
|
|
dispatch(setCustomGasPrice(decGWEIToHexWEI(fast))) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
dispatch(setCustomGasPrice(newPrice)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|