Skip to content

Commit

Permalink
getHexGasTotal and increaseLastGasPrice now gracefully handle null an…
Browse files Browse the repository at this point in the history
…d undefined values
  • Loading branch information
danjm committed Mar 27, 2019
1 parent 8108eac commit 0346089
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/app/helpers/utils/confirm-tx.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
Expand Down

0 comments on commit 0346089

Please sign in to comment.