mirror of
https://github.com/status-im/visual-identity.git
synced 2025-02-13 04:57:03 +00:00
Added gas estimation
This commit is contained in:
parent
b96ecd5a20
commit
5e9a0da95c
@ -102,17 +102,20 @@ const AddPoll = withFormik({
|
|||||||
const { addPoll } = PollManager.methods;
|
const { addPoll } = PollManager.methods;
|
||||||
const currentBlock = await getBlockNumber();
|
const currentBlock = await getBlockNumber();
|
||||||
const endTime = currentBlock + (oneDayinBlocks * 90);
|
const endTime = currentBlock + (oneDayinBlocks * 90);
|
||||||
addPoll(
|
|
||||||
endTime,
|
const toSend = addPoll(endTime, singleChoiceDef(description, ['YES']));
|
||||||
singleChoiceDef(description, ['YES', 'NO'])
|
toSend.estimateGas()
|
||||||
)
|
.then(gasEstimated => {
|
||||||
.send()
|
console.log("addPoll gas estimated: "+gasEstimated);
|
||||||
|
return toSend.send({gas: gasEstimated + 1000});
|
||||||
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log('sucess:', res);
|
console.log('sucess:', res);
|
||||||
})
|
})
|
||||||
.catch(res => {
|
.catch(res => {
|
||||||
console.log('fail:', res);
|
console.log('fail:', res);
|
||||||
})
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
})(StyledForm)
|
})(StyledForm)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user