added a test helper with common constants (#1400)
* signing prefix added
* Minor improvement
* Tests changed
* Successfully tested
* Minor improvements
* Minor improvements
* Revert "Dangling commas are now required. (#1359)"
This reverts commit a6889776f4.
* updates
* fixes #1206
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
const { assertRevert } = require('../helpers/assertRevert');
|
||||
const { MAX_UINT256 } = require('../helpers/constants');
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
const SafeMathMock = artifacts.require('SafeMathMock');
|
||||
@ -8,8 +9,6 @@ require('chai')
|
||||
.should();
|
||||
|
||||
contract('SafeMath', function () {
|
||||
const MAX_UINT = new BigNumber(2).pow(256).minus(1);
|
||||
|
||||
beforeEach(async function () {
|
||||
this.safeMath = await SafeMathMock.new();
|
||||
});
|
||||
@ -23,7 +22,7 @@ contract('SafeMath', function () {
|
||||
});
|
||||
|
||||
it('throws a revert error on addition overflow', async function () {
|
||||
const a = MAX_UINT;
|
||||
const a = MAX_UINT256;
|
||||
const b = new BigNumber(1);
|
||||
|
||||
await assertRevert(this.safeMath.add(a, b));
|
||||
@ -62,7 +61,7 @@ contract('SafeMath', function () {
|
||||
});
|
||||
|
||||
it('throws a revert error on multiplication overflow', async function () {
|
||||
const a = MAX_UINT;
|
||||
const a = MAX_UINT256;
|
||||
const b = new BigNumber(2);
|
||||
|
||||
await assertRevert(this.safeMath.mul(a, b));
|
||||
|
||||
Reference in New Issue
Block a user