Files
openzeppelin-contracts/test/helpers/expectThrow.js
Remco Bloemen d1af3ef1b3 Add HasNoEther
2017-03-23 12:23:27 +00:00

13 lines
393 B
JavaScript

export default async promise => {
try {
await promise;
} catch (error) {
// TODO: Check jump destination to destinguish between a throw
// and an actual invalid jump.
const invalidJump = error.message.search('invalid JUMP') >= 0;
assert(invalidJump, "Expected throw, got '" + error + "' instead");
return;
}
assert.fail('Expected throw not received');
};