From 49a7b84f14d713a8fd1756cfe9f16d786641ad64 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sat, 29 Oct 2016 15:32:10 +0200 Subject: [PATCH] Pass gas & gasPrice to token transfers (#2964) --- js/src/dapps/gavcoin/Actions/ActionBuyIn/actionBuyIn.js | 2 +- js/src/modals/Transfer/transfer.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/js/src/dapps/gavcoin/Actions/ActionBuyIn/actionBuyIn.js b/js/src/dapps/gavcoin/Actions/ActionBuyIn/actionBuyIn.js index 42de205c1..fe67c3739 100644 --- a/js/src/dapps/gavcoin/Actions/ActionBuyIn/actionBuyIn.js +++ b/js/src/dapps/gavcoin/Actions/ActionBuyIn/actionBuyIn.js @@ -43,7 +43,7 @@ export default class ActionBuyIn extends Component { accountError: ERRORS.invalidAccount, amount: 0, amountError: ERRORS.invalidAmount, - maxPrice: api.util.fromWei(this.props.price.mul(1.2)).toString(), + maxPrice: api.util.fromWei(this.props.price.mul(1.2)).toFixed(0), maxPriceError: null, sending: false, complete: false diff --git a/js/src/modals/Transfer/transfer.js b/js/src/modals/Transfer/transfer.js index 2217d0e9c..0ffad525c 100644 --- a/js/src/modals/Transfer/transfer.js +++ b/js/src/modals/Transfer/transfer.js @@ -420,13 +420,15 @@ export default class Transfer extends Component { _sendToken () { const { account, balance } = this.props; - const { recipient, value, tag } = this.state; + const { gas, gasPrice, recipient, value, tag } = this.state; const token = balance.tokens.find((balance) => balance.token.tag === tag).token; return token.contract.instance.transfer .postTransaction({ from: account.address, - to: token.address + to: token.address, + gas, + gasPrice }, [ recipient, new BigNumber(value).mul(token.format).toFixed(0) @@ -483,7 +485,7 @@ export default class Transfer extends Component { to: token.address }, [ recipient, - new BigNumber(value || 0).mul(token.format).toString() + new BigNumber(value || 0).mul(token.format).toFixed(0) ]); }