I don't remember the previous versions I was using but I remember upgrading because I hoped to have a local test network (via Ganache) supporting EIP-1559. My versions are:
Truffle v5.11.5 (core: 5.11.5)
Ganache v7.9.1
Solidity - 0.8.10 (solc-js)
Node v18.18.0
Web3.js v1.10.0
But there's something weird here:
- Tests that were expected to succeed (and designed in that way) have no problem.
- For some tests that expect a revert (and were also designed in that way) I had to change the captured revert message.
- But there are a lot of tests that expect a failure (using expectRevert) that expected certain text to exist, and now I get a big payload with no description instead.
For example, take this code which is part of a well-designed test:
await expectRevert(
payments.executePaymentOrderConfirmationCall(
obj, web3, accounts[9], economy.address, economy.abi, realWorldPaymentsPlugin.address,
realWorldPaymentsPlugin.abi, false, {amount: gasAmount}
),
"RealWorldPaymentsPlugin: payment already processed"
);
I remember this test (and many others like this one) to pass (i.e. the operation I made in that exact code moment indeed belonged to a payment already being processed). But for this exception I get this message instead:
Wrong kind of exception received
+ expected - actual
-Transaction has been reverted by the EVM:
-{
- "transactionHash": "0x94fde2832f19dd6aef96c262982cd0a3b916b023206c44d8344894d7475e4d60",
- "transactionIndex": 0,
- "blockNumber": 59,
- "blockHash": "0xc19bc86efddf4d43957c72cbce27c89053e4347e0d5ddc3b516970a8cf9505c9",
- "from": "0x5aeda56215b167893e80b4fe645ba6d5bab767de",
- "to": "0xb9b7e0cb2edf5ea031c8b297a5a1fa20379b6a0a",
- "cumulativeGasUsed": 65459,
- "gasUsed": 65459,
- "contractAddress": null,
- "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
- "status": false,
- "effectiveGasPrice": 2505438371,
- "type": "0x2",
- "events": {}
-}
+RealWorldPaymentsPlugin: payment already processed
I ensured I'm giving a lot of gas (and I believe this should not be a problem, since this was working before), literally more than 100000 units. What am I doing wrong?
- Is a matter of library versions? Are there bugs here? (again: this only happens when capturing these exceptions)
- Is because this network now supports 1559 and I'm forgetting something?
- How do I retrieve or understand a meaningful description out of that payload?