1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Merge pull request #6358 from MetaMask/dont-assume-tx-has-gas-data-in-list

Gracefully handle null/undefined in a couple methods that operate on hex values
This commit is contained in:
Thomas Huang 2019-03-27 17:39:10 -04:00 committed by GitHub
commit a239ef4dd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ import {
import { unconfirmedTransactionsCountSelector } from '../../selectors/confirm-transaction'
export function increaseLastGasPrice (lastGasPrice) {
export function increaseLastGasPrice (lastGasPrice = '0x0') {
return ethUtil.addHexPrefix(multiplyCurrencies(lastGasPrice, 1.1, {
multiplicandBase: 16,
multiplierBase: 10,
@ -27,7 +27,7 @@ export function hexGreaterThan (a, b) {
)
}
export function getHexGasTotal ({ gasLimit, gasPrice }) {
export function getHexGasTotal ({ gasLimit = '0x0', gasPrice = '0x0' }) {
return ethUtil.addHexPrefix(multiplyCurrencies(gasLimit, gasPrice, {
toNumericBase: 'hex',
multiplicandBase: 16,