New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnhandledPromiseRejectionWarning on sendSignedTransaction #2394
Comments
Thanks for submitting this issue! I will check it and if required fix it asap. |
Same error here. |
@r3dh4r7 I've tried to reproduce this but the error didn't occur. Could you please add the code lines you are using here? |
@nivida It's basically a loop through addresses from const txObj = await web3.eth.personal.signTransaction({
gasPrice: web3.utils.toHex(web3.utils.toWei('15', 'gwei')),
gas: web3.utils.toHex(21000),
from: BENEFACTORS[i],
to: BENEFICIARY,
value: web3.utils.toWei('0.1', 'ether')
}, COMMON_BENEFACTOR_PASSPHRASE)
const tx = await new Promise(resolve => {
try {
web3.eth.sendSignedTransaction(txObj.raw)
.on('receipt', receipt => {
resolve(receipt)
})
.catch((err) => {
console.log('This does not work', err)
resolve(false)
})
} catch (e) {
console.log('This does not work either', e)
resolve(false)
}
}) Value and gas price are hardcoded here to simplify the snippet. I obtain those dynamically with |
Have the same issue with latest version. I don't get the error even with .on("error", ...) callback. Using async function await with try also give the same error. If I use the raw tx with a curl I am able to see it. Example of a false spending, the accounts has 0 funds: const options = { const Web3 = require("web3"); async function sendEther() { sendEther(); |
I just confirmed. This is still an issue as of beta 52. |
Will check that tomorrow closer. Thanks for testing it!:) |
I'm having an issue that might be related. I'm not getting an UnhandledPromiseRejectionWarning but sendSignedTransaction() never resolves. Neither .on('receipt') nor .then() ever get called. I'm using Infura and after calling sendSignedTransaction() (which never resolves) an infinite loop of xhr requests ensues at a rate of about 2 per second. |
@JonahGroendal You have to configure the transactionConfirmationBlocks and we have currently an issue with the increasing of the block number over an HTTP connection. #2661 |
Expected behavior
Errors should be trapped in callback error field or promise
catch(e => {})
.Actual behavior
Not even a combination of try/catch and
catch(e => {})
can trap this. It's never bubbled up.Steps to reproduce the behavior
I haven't been able to figure out a precise way to reproduce this, except calling
web3.eth.sendSignedTransaction
leads here sometimes.Error Logs
Versions
Node: 10.14.2
NPM: 6.7.0
OS: Debian 9
Web3: 1.0.0-beta.46
The text was updated successfully, but these errors were encountered: