From b80c7e417bfa3adf338170472ba4c4c6733e8402 Mon Sep 17 00:00:00 2001 From: frankiebee Date: Wed, 2 Aug 2017 18:58:05 -0400 Subject: move newUnapprovedTransaction to transactions.js --- app/scripts/lib/tx-utils.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'app/scripts/lib') diff --git a/app/scripts/lib/tx-utils.js b/app/scripts/lib/tx-utils.js index 24ea2d763..0e5b6a999 100644 --- a/app/scripts/lib/tx-utils.js +++ b/app/scripts/lib/tx-utils.js @@ -86,14 +86,10 @@ module.exports = class txProvideUtils { return this.query.sendRawTransaction(rawTx) } - validateTxParams (txParams) { - return new Promise((resolve, reject) => { - if (('value' in txParams) && txParams.value.indexOf('-') === 0) { - reject(new Error(`Invalid transaction value of ${txParams.value} not a positive number.`)) - } else { - resolve() - } - }) + async validateTxParams (txParams) { + if (('value' in txParams) && txParams.value.indexOf('-') === 0) { + throw new Error(`Invalid transaction value of ${txParams.value} not a positive number.`) + } } sufficientBalance (txParams, hexBalance) { -- cgit