Replaced assertJump, assertRevert and expectThrow with shouldFail. (#1363)
* Replaced assertJump, assertRevert and expectThrow with shouldFail.
* Fixed linter errors.
* Fixed typo.
* Made the helpers async.
(cherry picked from commit b0da0fded0)
This commit is contained in:
committed by
Leo Arias
parent
620d524398
commit
7cd0d5a452
@ -1,4 +1,4 @@
|
||||
const { assertRevert } = require('../helpers/assertRevert');
|
||||
const shouldFail = require('../helpers/shouldFail');
|
||||
const { MAX_UINT256 } = require('../helpers/constants');
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
@ -25,7 +25,7 @@ contract('SafeMath', function () {
|
||||
const a = MAX_UINT256;
|
||||
const b = new BigNumber(1);
|
||||
|
||||
await assertRevert(this.safeMath.add(a, b));
|
||||
await shouldFail.reverting(this.safeMath.add(a, b));
|
||||
});
|
||||
});
|
||||
|
||||
@ -41,7 +41,7 @@ contract('SafeMath', function () {
|
||||
const a = new BigNumber(1234);
|
||||
const b = new BigNumber(5678);
|
||||
|
||||
await assertRevert(this.safeMath.sub(a, b));
|
||||
await shouldFail.reverting(this.safeMath.sub(a, b));
|
||||
});
|
||||
});
|
||||
|
||||
@ -64,7 +64,7 @@ contract('SafeMath', function () {
|
||||
const a = MAX_UINT256;
|
||||
const b = new BigNumber(2);
|
||||
|
||||
await assertRevert(this.safeMath.mul(a, b));
|
||||
await shouldFail.reverting(this.safeMath.mul(a, b));
|
||||
});
|
||||
});
|
||||
|
||||
@ -80,7 +80,7 @@ contract('SafeMath', function () {
|
||||
const a = new BigNumber(5678);
|
||||
const b = new BigNumber(0);
|
||||
|
||||
await assertRevert(this.safeMath.div(a, b));
|
||||
await shouldFail.reverting(this.safeMath.div(a, b));
|
||||
});
|
||||
});
|
||||
|
||||
@ -119,7 +119,7 @@ contract('SafeMath', function () {
|
||||
const a = new BigNumber(5678);
|
||||
const b = new BigNumber(0);
|
||||
|
||||
await assertRevert(this.safeMath.mod(a, b));
|
||||
await shouldFail.reverting(this.safeMath.mod(a, b));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user