Add HasNoTokens

This commit is contained in:
Remco Bloemen
2017-03-23 15:22:48 +00:00
parent 9ff82aecef
commit 94d3c447b7
4 changed files with 108 additions and 1 deletions

View File

@ -5,7 +5,15 @@ export default async promise => {
// 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");
// TODO: When we contract A calls contract B, and B throws, instead
// of an 'invalid jump', we get an 'out of gas' error. How do
// we distinguish this from an actual out of gas event? (The
// testrpc log actually show an 'invalid jump' event.)
const outOfGas = error.message.search('out of gas') >= 0;
assert(
invalidJump || outOfGas,
"Expected throw, got '" + error + "' instead",
);
return;
}
assert.fail('Expected throw not received');