There is an issue open with Truffle, in the meantime is there a work-around or anything else we could try to unblock development? I'm hesitant to start wrapping our tests with
try...catch blocks that just ignore the errors.
When a contract has an event defined and attempts to make an external call to another contract which emits an event with the same name the Truffle test throws the following error:
Error: Returned values aren't valid, did it run Out of Gas? at ABICoder.decodeParameters (node_modules\truffle\build\webpack:\~\web3-eth-abi\src\index.js:226:1) at ABICoder.decodeParameter (node_modules\truffle\build\webpack:\~\web3-eth-abi\src\index.js:213:1) at node_modules\truffle\build\webpack:\~\web3-eth-abi\src\index.js:274:14 at Array.forEach (<anonymous>) at ABICoder.decodeLog (node_modules\truffle\build\webpack:\~\web3-eth-abi\src\index.js:270:1) at node_modules\truffle\build\webpack:\packages\truffle-contract\lib\utils.js:60:1 at Array.map (<anonymous>) at Function.decodeLogs (node_modules\truffle\build\webpack:\packages\truffle-contract\lib\utils.js:44:1) at Promise.receipt (node_modules\truffle\build\webpack:\packages\truffle-contract\lib\handlers.js:98:1) at Promise.emit (node_modules\truffle\build\webpack:\~\eventemitter3\index.js:89:1) at node_modules\truffle\build\webpack:\~\web3-eth\~\web3-core-method\src\index.js:353:1 at process._tickCallback (internal/process/next_tick.js:68:7)
It seems you can
try...catch the error and ignore it. The transaction does process successfully.
More specifically: we are creating a contract with implements ERC721. ERC721 has the following event:
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
Our contract then attempts to call
transferFromon an ERC20 token, which emits the following:
event Transfer(address indexed _from, address indexed _to, uint256 _value)
The issue occurs when that Transfer event is emitted.
How to repo:
Turning off Ganache's
auto-mine did not fix the issue. Switching to use the Web3 API to make the call results in the test hanging (instead of throwing an error). There's a bit more detail about these attempts in the example repo.
Also, can we even be sure this is an issue with Truffle vs maybe Ganache?