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

(cherry picked from commit 58a42443df)
This commit is contained in:
Aniket
2018-10-10 00:16:09 +05:30
committed by Nicolás Venturo
parent a811a0be28
commit 9f5b73df37
22 changed files with 36 additions and 36 deletions

View File

@ -1,5 +1,6 @@
const { assertRevert } = require('../../helpers/assertRevert');
const expectEvent = require('../../helpers/expectEvent');
const { ZERO_ADDRESS } = require('../../helpers/constants');
const ERC20 = artifacts.require('ERC20Mock');
@ -10,8 +11,6 @@ require('chai')
.should();
contract('ERC20', function ([_, owner, recipient, anotherAccount]) {
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
beforeEach(async function () {
this.token = await ERC20.new(owner, 100);
});

View File

@ -3,6 +3,7 @@ const { EVMRevert } = require('../../helpers/EVMRevert');
const { latestTime } = require('../../helpers/latestTime');
const { increaseTimeTo, duration } = require('../../helpers/increaseTime');
const { ethGetBlock } = require('../../helpers/web3');
const { ZERO_ADDRESS } = require('../../helpers/constants');
const BigNumber = web3.BigNumber;
@ -15,7 +16,6 @@ const TokenVesting = artifacts.require('TokenVesting');
contract('TokenVesting', function ([_, owner, beneficiary]) {
const amount = new BigNumber(1000);
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
beforeEach(async function () {
this.start = (await latestTime()) + duration.minutes(1); // +1 minute so it starts after contract instantiation

View File

@ -1,8 +1,8 @@
const { assertRevert } = require('../../../helpers/assertRevert');
const expectEvent = require('../../../helpers/expectEvent');
const { ZERO_ADDRESS } = require('../../../helpers/constants');
const BigNumber = web3.BigNumber;
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
require('chai')
.use(require('chai-bignumber')(BigNumber))

View File

@ -1,5 +1,6 @@
const { assertRevert } = require('../../../helpers/assertRevert');
const expectEvent = require('../../../helpers/expectEvent');
const { ZERO_ADDRESS } = require('../../../helpers/constants');
const BigNumber = web3.BigNumber;
@ -8,8 +9,6 @@ require('chai')
.should();
function shouldBehaveLikeERC20Mintable (minter, [anyone]) {
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
describe('as a mintable token', function () {
describe('mint', function () {
const amount = 100;

View File

@ -1,5 +1,6 @@
const { shouldSupportInterfaces } = require('../../introspection/SupportsInterface.behavior');
const { assertRevert } = require('../../helpers/assertRevert');
const { ZERO_ADDRESS } = require('../../helpers/constants');
const { decodeLogs } = require('../../helpers/decodeLogs');
const { sendTransaction } = require('../../helpers/sendTransaction');
const _ = require('lodash');
@ -19,7 +20,6 @@ function shouldBehaveLikeERC721 (
const firstTokenId = 1;
const secondTokenId = 2;
const unknownTokenId = 3;
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
const RECEIVER_MAGIC_VALUE = '0x150b7a02';
describe('like an ERC721', function () {

View File

@ -1,5 +1,6 @@
const { assertRevert } = require('../../helpers/assertRevert');
const expectEvent = require('../../helpers/expectEvent');
const { ZERO_ADDRESS } = require('../../helpers/constants');
const BigNumber = web3.BigNumber;
require('chai')
@ -15,7 +16,6 @@ function shouldBehaveLikeMintAndBurnERC721 (
const secondTokenId = 2;
const thirdTokenId = 3;
const unknownTokenId = 4;
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
const MOCK_URI = 'https://example.com';
describe('like a mintable and burnable ERC721', function () {

View File

@ -1,5 +1,6 @@
const { assertRevert } = require('../../helpers/assertRevert');
const { sendTransaction } = require('../../helpers/sendTransaction');
const { ZERO_ADDRESS } = require('../../helpers/constants');
const BigNumber = web3.BigNumber;
@ -11,7 +12,6 @@ function shouldBehaveLikeERC721PausedToken (owner, [recipient, operator]) {
const firstTokenId = 1;
const mintedTokens = 1;
const mockData = '0x42';
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
describe('like a paused ERC721', function () {
beforeEach(async function () {