We now ensure that if an exception is thrown while awaiting the promise, the exception _has_ to be a revert. We throw 'Expected revert not received' only afterwards. This solves any problems with confusing the word 'revert'. Fix #775
@@ -1,11 +1,12 @@
async function assertRevert (promise) {
try {
await promise;
- assert.fail('Expected revert not received');
} catch (error) {
const revertFound = error.message.search('revert') >= 0;
assert(revertFound, `Expected "revert", got ${error} instead`);
+ return;
}
+ assert.fail('Expected revert not received');
module.exports = {