OpenZeppelin / openzeppelin-test-helpers

Assertion library for Ethereum smart contract testing
https://docs.openzeppelin.com/test-helpers
MIT License
415 stars 132 forks source link

expectRevert does not return a transaction receipt #58

Open nventuro opened 5 years ago

nventuro commented 5 years ago

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

nventuro commented 5 years ago

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).