openzeppelin-test-helpers icon indicating copy to clipboard operation
openzeppelin-test-helpers copied to clipboard

expectRevert does not return a transaction receipt

Open nventuro opened this issue 6 years ago • 1 comments

Reverted transactions still have a transaction receipt with has, used gas, etc.: we should return this object to the caller.

nventuro avatar Jun 26 '19 00:06 nventuro

The promise resolves to an error string: in order to get the receipt, we should use the PromiEvent event listeners (either error or promise). However, as is discussed in https://github.com/ethereum/web3.js/issues/2612 and https://github.com/ethereum/web3.js/issues/1859, on v1.2 of web3js a) receipt is not fired on failed transactions, and b) the receipt is not included on the error event.

This has been fixed on the 2.x branch, and will be backported to the 1.x soon (as part of the https://github.com/ethereum/web3.js/issues/3070 initiative).

nventuro avatar Oct 08 '19 19:10 nventuro