From 0346089caac58f5866e770999fd0055e16c52d78 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Wed, 27 Mar 2019 15:57:44 -0230 Subject: getHexGasTotal and increaseLastGasPrice now gracefully handle null and undefined values --- ui/app/helpers/utils/confirm-tx.util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/app/helpers/utils/confirm-tx.util.js b/ui/app/helpers/utils/confirm-tx.util.js index f843db118..853427b31 100644 --- a/ui/app/helpers/utils/confirm-tx.util.js +++ b/ui/app/helpers/utils/confirm-tx.util.js @@ -13,7 +13,7 @@ import { import { unconfirmedTransactionsCountSelector } from '../../selectors/confirm-transaction' export function increaseLastGasPrice (lastGasPrice) { - return ethUtil.addHexPrefix(multiplyCurrencies(lastGasPrice, 1.1, { + return ethUtil.addHexPrefix(multiplyCurrencies(lastGasPrice || '0x0', 1.1, { multiplicandBase: 16, multiplierBase: 10, toNumericBase: 'hex', @@ -28,7 +28,7 @@ export function hexGreaterThan (a, b) { } export function getHexGasTotal ({ gasLimit, gasPrice }) { - return ethUtil.addHexPrefix(multiplyCurrencies(gasLimit, gasPrice, { + return ethUtil.addHexPrefix(multiplyCurrencies(gasLimit || '0x0', gasPrice || '0x0', { toNumericBase: 'hex', multiplicandBase: 16, multiplierBase: 16, -- cgit From 31d8b279e43b7ebd6fcb11752d24c67f12a6b622 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Wed, 27 Mar 2019 17:01:25 -0230 Subject: Defaults to the args list in increaseLastGasPrice and getHexGasTotal --- ui/app/helpers/utils/confirm-tx.util.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/app/helpers/utils/confirm-tx.util.js b/ui/app/helpers/utils/confirm-tx.util.js index 853427b31..224560f5a 100644 --- a/ui/app/helpers/utils/confirm-tx.util.js +++ b/ui/app/helpers/utils/confirm-tx.util.js @@ -12,8 +12,8 @@ import { import { unconfirmedTransactionsCountSelector } from '../../selectors/confirm-transaction' -export function increaseLastGasPrice (lastGasPrice) { - return ethUtil.addHexPrefix(multiplyCurrencies(lastGasPrice || '0x0', 1.1, { +export function increaseLastGasPrice (lastGasPrice = '0x0') { + return ethUtil.addHexPrefix(multiplyCurrencies(lastGasPrice, 1.1, { multiplicandBase: 16, multiplierBase: 10, toNumericBase: 'hex', @@ -27,8 +27,8 @@ export function hexGreaterThan (a, b) { ) } -export function getHexGasTotal ({ gasLimit, gasPrice }) { - return ethUtil.addHexPrefix(multiplyCurrencies(gasLimit || '0x0', gasPrice || '0x0', { +export function getHexGasTotal ({ gasLimit = '0x0', gasPrice = '0x0' }) { + return ethUtil.addHexPrefix(multiplyCurrencies(gasLimit, gasPrice, { toNumericBase: 'hex', multiplicandBase: 16, multiplierBase: 16, -- cgit