diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-08-03 06:58:05 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-08-03 06:59:34 +0800 |
commit | b80c7e417bfa3adf338170472ba4c4c6733e8402 (patch) | |
tree | 82ed6f3930cdea74edcd8b081112298b8acf613c /app/scripts/lib/tx-utils.js | |
parent | 25bc15ba175091513f6d281e9a16f3643fe4b18d (diff) | |
download | tangerine-wallet-browser-b80c7e417bfa3adf338170472ba4c4c6733e8402.tar tangerine-wallet-browser-b80c7e417bfa3adf338170472ba4c4c6733e8402.tar.gz tangerine-wallet-browser-b80c7e417bfa3adf338170472ba4c4c6733e8402.tar.bz2 tangerine-wallet-browser-b80c7e417bfa3adf338170472ba4c4c6733e8402.tar.lz tangerine-wallet-browser-b80c7e417bfa3adf338170472ba4c4c6733e8402.tar.xz tangerine-wallet-browser-b80c7e417bfa3adf338170472ba4c4c6733e8402.tar.zst tangerine-wallet-browser-b80c7e417bfa3adf338170472ba4c4c6733e8402.zip |
move newUnapprovedTransaction to transactions.js
Diffstat (limited to 'app/scripts/lib/tx-utils.js')
-rw-r--r-- | app/scripts/lib/tx-utils.js | 12 |
1 files changed, 4 insertions, 8 deletions
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) { |