Pass gas & gasPrice to token transfers (#2964)

This commit is contained in:
Jaco Greeff 2016-10-29 15:32:10 +02:00 committed by Gav Wood
parent 144930f12c
commit 49a7b84f14
2 changed files with 6 additions and 4 deletions

View File

@ -43,7 +43,7 @@ export default class ActionBuyIn extends Component {
accountError: ERRORS.invalidAccount, accountError: ERRORS.invalidAccount,
amount: 0, amount: 0,
amountError: ERRORS.invalidAmount, 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, maxPriceError: null,
sending: false, sending: false,
complete: false complete: false

View File

@ -420,13 +420,15 @@ export default class Transfer extends Component {
_sendToken () { _sendToken () {
const { account, balance } = this.props; 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; const token = balance.tokens.find((balance) => balance.token.tag === tag).token;
return token.contract.instance.transfer return token.contract.instance.transfer
.postTransaction({ .postTransaction({
from: account.address, from: account.address,
to: token.address to: token.address,
gas,
gasPrice
}, [ }, [
recipient, recipient,
new BigNumber(value).mul(token.format).toFixed(0) new BigNumber(value).mul(token.format).toFixed(0)
@ -483,7 +485,7 @@ export default class Transfer extends Component {
to: token.address to: token.address
}, [ }, [
recipient, recipient,
new BigNumber(value || 0).mul(token.format).toString() new BigNumber(value || 0).mul(token.format).toFixed(0)
]); ]);
} }