From b2623510aec78cbabdcb4bbfaf5c9c406f4e428a Mon Sep 17 00:00:00 2001 From: Frankie Date: Tue, 24 Jan 2017 13:19:26 -0800 Subject: [PATCH 1/3] Fix issue where ConfTx view lets you approve txs when the account has insufficient balance --- ui/app/conf-tx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js index a6e03c3ed..d5c26d79f 100644 --- a/ui/app/conf-tx.js +++ b/ui/app/conf-tx.js @@ -136,7 +136,7 @@ ConfirmTxScreen.prototype.checkBalanceAgainstTx = function (txData) { var balance = account ? account.balance : '0x0' var maxCost = new BN(txData.maxCost) - var balanceBn = new BN(ethUtil.stripHexPrefix(balance), 16) + var balanceBn = new BN(ethUtil.stripHexPrefix(balance), 10) return maxCost.gt(balanceBn) } From 42bb90341dde5699dca4ba7ad8891f26c1faf4a6 Mon Sep 17 00:00:00 2001 From: Frankie Date: Tue, 24 Jan 2017 13:21:15 -0800 Subject: [PATCH 2/3] add to CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa825e860..cced970cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Current Master +- Fix rendering bug where the Confirm transaction view would lets you approve transactions when the account has insufficient balance. - Add ability to import accounts in JSON file format (used by Mist, Geth, MyEtherWallet, and more!) ## 3.1.1 2017-1-20 From 8ed657d5d574389a1b4c44d127ecf37f86cc7e64 Mon Sep 17 00:00:00 2001 From: Frankie Date: Tue, 24 Jan 2017 14:53:45 -0800 Subject: [PATCH 3/3] fix base --- ui/app/conf-tx.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js index d5c26d79f..1bd69f7d9 100644 --- a/ui/app/conf-tx.js +++ b/ui/app/conf-tx.js @@ -134,9 +134,9 @@ ConfirmTxScreen.prototype.checkBalanceAgainstTx = function (txData) { var address = txData.txParams.from || state.selectedAccount var account = state.accounts[address] var balance = account ? account.balance : '0x0' - var maxCost = new BN(txData.maxCost) + var maxCost = new BN(txData.maxCost, 16) - var balanceBn = new BN(ethUtil.stripHexPrefix(balance), 10) + var balanceBn = new BN(ethUtil.stripHexPrefix(balance), 16) return maxCost.gt(balanceBn) }