aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send_/send-footer/send-footer.utils.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-05-05 23:11:53 +0800
committerDan <danjm.com@gmail.com>2018-05-05 23:58:14 +0800
commit7c490098548522c16be1b1e84bce37f5bf87f1f4 (patch)
tree207cabcc9c8a07c411ae293894895f32905986be /ui/app/components/send_/send-footer/send-footer.utils.js
parente869d09c79b0ba276cb6a82da1f01b2d4bfefce7 (diff)
downloadtangerine-wallet-browser-7c490098548522c16be1b1e84bce37f5bf87f1f4.tar
tangerine-wallet-browser-7c490098548522c16be1b1e84bce37f5bf87f1f4.tar.gz
tangerine-wallet-browser-7c490098548522c16be1b1e84bce37f5bf87f1f4.tar.bz2
tangerine-wallet-browser-7c490098548522c16be1b1e84bce37f5bf87f1f4.tar.lz
tangerine-wallet-browser-7c490098548522c16be1b1e84bce37f5bf87f1f4.tar.xz
tangerine-wallet-browser-7c490098548522c16be1b1e84bce37f5bf87f1f4.tar.zst
tangerine-wallet-browser-7c490098548522c16be1b1e84bce37f5bf87f1f4.zip
Unit tests for containers, utils and selectors in send_/
Diffstat (limited to 'ui/app/components/send_/send-footer/send-footer.utils.js')
-rw-r--r--ui/app/components/send_/send-footer/send-footer.utils.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/app/components/send_/send-footer/send-footer.utils.js b/ui/app/components/send_/send-footer/send-footer.utils.js
index 353c0e347..149d9e357 100644
--- a/ui/app/components/send_/send-footer/send-footer.utils.js
+++ b/ui/app/components/send_/send-footer/send-footer.utils.js
@@ -1,6 +1,6 @@
-import ethAbi from 'ethereumjs-abi'
-import ethUtil from 'ethereumjs-util'
-import { TOKEN_TRANSFER_FUNCTION_SIGNATURE } from '../send.constants'
+const ethAbi = require('ethereumjs-abi')
+const ethUtil = require('ethereumjs-util')
+const { TOKEN_TRANSFER_FUNCTION_SIGNATURE } = require('../send.constants')
function formShouldBeDisabled ({ inError, selectedToken, tokenBalance, gasTotal }) {
const missingTokenBalance = selectedToken && !tokenBalance
@@ -47,6 +47,7 @@ function constructUpdatedTx ({
}
if (selectedToken) {
+ console.log(`ethAbi.rawEncode`, ethAbi.rawEncode)
const data = TOKEN_TRANSFER_FUNCTION_SIGNATURE + Array.prototype.map.call(
ethAbi.rawEncode(['address', 'uint256'], [to, ethUtil.addHexPrefix(amount)]),
x => ('00' + x.toString(16)).slice(-2)
@@ -70,6 +71,8 @@ function constructUpdatedTx ({
delete editingTx.txParams.data
}
}
+
+ return editingTx
}
function addressIsNew (toAccounts, newAddress) {
@@ -81,4 +84,5 @@ module.exports = {
formShouldBeDisabled,
constructTxParams,
constructUpdatedTx,
+ addHexPrefixToObjectValues,
}