Added gas estimation for transaction on Transfer Dialog

This commit is contained in:
Richard Ramos 2018-12-11 15:08:30 -04:00 committed by Barry G
parent bdf4c373f8
commit 12f685bfb5

View File

@ -21,8 +21,11 @@ const TransferDialog = ({ row, handleClose, transferPledgeAmounts }) => (
const { id } = row
const { idSender, amount, idReceiver } = values
const args = [idSender, id, toWei(amount.toString()), idReceiver]
transfer(...args)
.send()
const toSend = transfer(...args);
const estimatedGas = await toSend.estimateGas();
toSend.send({gas: estimatedGas + 1000})
.then(res => {
console.log({res})
const { events: { Transfer: { returnValues } } } = res