Replaced assertJump, assertRevert and expectThrow with shouldFail. (#1363)

* Replaced assertJump, assertRevert and expectThrow with shouldFail.

* Fixed linter errors.

* Fixed typo.

* Made the helpers async.
This commit is contained in:
Nicolás Venturo
2018-10-09 16:23:55 -03:00
committed by GitHub
parent 58a42443df
commit b0da0fded0
46 changed files with 282 additions and 352 deletions

View File

@ -1,5 +1,4 @@
const { expectThrow } = require('../helpers/expectThrow');
const { EVMRevert } = require('../helpers/EVMRevert');
const shouldFail = require('../helpers/shouldFail');
const expectEvent = require('../helpers/expectEvent');
const { ZERO_ADDRESS } = require('../helpers/constants');
@ -22,11 +21,11 @@ function shouldBehaveLikeOwnable (owner, [anyone]) {
});
it('should prevent non-owners from transfering', async function () {
await expectThrow(this.ownable.transferOwnership(anyone, { from: anyone }), EVMRevert);
await shouldFail.reverting(this.ownable.transferOwnership(anyone, { from: anyone }));
});
it('should guard ownership against stuck state', async function () {
await expectThrow(this.ownable.transferOwnership(null, { from: owner }), EVMRevert);
await shouldFail.reverting(this.ownable.transferOwnership(null, { from: owner }));
});
it('loses owner after renouncement', async function () {
@ -37,7 +36,7 @@ function shouldBehaveLikeOwnable (owner, [anyone]) {
});
it('should prevent non-owners from renouncement', async function () {
await expectThrow(this.ownable.renounceOwnership({ from: anyone }), EVMRevert);
await shouldFail.reverting(this.ownable.renounceOwnership({ from: anyone }));
});
});
}