for example a call like eth_sendRawTransaction might fail with {"jsonrpc":"2.0","id":42,"error":{"code":-32000,"message":"insufficient funds for gas * price + value"}}
instead, the call just returns a resolved Promise of undefined. this is because here:
https://github.com/ethers-io/ethers.js/blob/7250cdcd31c08c88e97cb8ee1f8e808ea030f88d/src.ts/providers/ipc-provider.ts#L57
the .error property is just completely ignored and instead .result is returned (which does not exist on error).
This is a pretty bad issue because for some calls (like sendTransaction) whether or not the call succeeded is very significant.
I will look into this as soon as I can. For the v5 tests we have a Parity node deployed alongside the CI, so we鈥檒l finally have proper test cases for the IpcProvider.
You are absolutely correct.
I've reproduced this and am working on a fix to process errors the same way the JsonRpcProvider does.
I think this should be fixed now in 4.0.42. Please try it out and let me know if you have any problems.
Thanks! :)
Thank you!
Code looks good I think. I'll reopen this if i encounter issues when I try again (in a few days).