diff --git a/lib/plugins/wallet/geth/base.js b/lib/plugins/wallet/geth/base.js index 6674dfd3..08ccffa8 100644 --- a/lib/plugins/wallet/geth/base.js +++ b/lib/plugins/wallet/geth/base.js @@ -54,22 +54,7 @@ function sendCoins (account, tx, settings, operatorId) { const { toAddress, cryptoAtoms, cryptoCode } = tx const isErc20Token = coins.utils.isErc20Token(cryptoCode) - if (isErc20Token) { - return generateErc20Tx(toAddress, defaultWallet(account), cryptoAtoms, false, cryptoCode) - .then(pify(web3.eth.sendSignedTransaction)) - .then(txid => { - return pify(web3.eth.getTransaction)(txid) - .then(tx => { - if (!tx) return { txid } - - const fee = new BN(tx.gas).times(new BN(tx.gasPrice)).decimalPlaces(0) - - return { txid, fee } - }) - }) - } - - return generateTx(toAddress, defaultWallet(account), cryptoAtoms, false, cryptoCode) + return (isErc20Token ? generateErc20Tx : generateTx)(toAddress, defaultWallet(account), cryptoAtoms, false, cryptoCode) .then(pify(web3.eth.sendSignedTransaction)) .then(txid => { return pify(web3.eth.getTransaction)(txid)