Include 'revert' in expectThrow() helper

This commit is contained in:
Alejandro Santander
2017-11-10 11:41:17 -03:00
parent 8e01dd14f9
commit 2413f83504
2 changed files with 12 additions and 11 deletions

20
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "zeppelin-solidity",
"version": "1.2.0",
"version": "1.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -5084,15 +5084,6 @@
"xtend": "4.0.1"
}
},
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
"integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
"dev": true,
"requires": {
"safe-buffer": "5.1.1"
}
},
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
@ -5115,6 +5106,15 @@
"function-bind": "1.1.0"
}
},
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
"integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
"dev": true,
"requires": {
"safe-buffer": "5.1.1"
}
},
"stringstream": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",

View File

@ -10,8 +10,9 @@ export default async promise => {
// 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;
const revert = error.message.search('revert') >= 0;
assert(
invalidOpcode || outOfGas,
invalidOpcode || outOfGas || revert,
"Expected throw, got '" + error + "' instead",
);
return;