1

I have the following:

function sendRaw(msg) {
  return new Promise(function(resolve, reject) {
    var txHash = config.web3.eth.sendRawTransaction(msg);
    if (!txHash) { reject('Could not submit raw transaction.'); }
    else { resolve(txHash); }
  })
}

I want the txHash regardless of whether or not the contract did/will throw. When I run this with testrpc, my call somehow catches the contract throw as an error from testrpc and doesn't return the tx hash as it should.

Is this a testrpc problem? If so, is there a way to configure testrpc to not do this?

1

Answering my own question here. You can pass a block time parameter to testrpc. 0.1s does the trick for me:

testrpc -b 0.1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.