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,13 +1,11 @@
|
|||||||
const { assertRevert } = require('../helpers/assertRevert');
|
const { assertRevert } = require('../helpers/assertRevert');
|
||||||
|
const { ZERO_ADDRESS } = require('../helpers/constants');
|
||||||
const RolesMock = artifacts.require('RolesMock');
|
const RolesMock = artifacts.require('RolesMock');
|
||||||
|
|
||||||
require('chai')
|
require('chai')
|
||||||
.should();
|
.should();
|
||||||
|
|
||||||
contract('Roles', function ([_, authorized, otherAuthorized, anyone]) {
|
contract('Roles', function ([_, authorized, otherAuthorized, anyone]) {
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
this.roles = await RolesMock.new();
|
this.roles = await RolesMock.new();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
const { assertRevert } = require('../../helpers/assertRevert');
|
const { assertRevert } = require('../../helpers/assertRevert');
|
||||||
|
const { ZERO_ADDRESS } = require('../../helpers/constants');
|
||||||
const expectEvent = require('../../helpers/expectEvent');
|
const expectEvent = require('../../helpers/expectEvent');
|
||||||
|
|
||||||
require('chai')
|
require('chai')
|
||||||
@ -10,7 +11,6 @@ function capitalize (str) {
|
|||||||
|
|
||||||
function shouldBehaveLikePublicRole (authorized, otherAuthorized, [anyone], rolename) {
|
function shouldBehaveLikePublicRole (authorized, otherAuthorized, [anyone], rolename) {
|
||||||
rolename = capitalize(rolename);
|
rolename = capitalize(rolename);
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
describe('should behave like public role', function () {
|
describe('should behave like public role', function () {
|
||||||
beforeEach('check preconditions', async function () {
|
beforeEach('check preconditions', async function () {
|
||||||
|
|||||||
@ -2,6 +2,7 @@ const expectEvent = require('../helpers/expectEvent');
|
|||||||
const { ether } = require('../helpers/ether');
|
const { ether } = require('../helpers/ether');
|
||||||
const { assertRevert } = require('../helpers/assertRevert');
|
const { assertRevert } = require('../helpers/assertRevert');
|
||||||
const { ethGetBalance } = require('../helpers/web3');
|
const { ethGetBalance } = require('../helpers/web3');
|
||||||
|
const { ZERO_ADDRESS } = require('../helpers/constants');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
|
|
||||||
@ -17,7 +18,6 @@ contract('AllowanceCrowdsale', function ([_, investor, wallet, purchaser, tokenW
|
|||||||
const value = ether(0.42);
|
const value = ether(0.42);
|
||||||
const expectedTokenAmount = rate.mul(value);
|
const expectedTokenAmount = rate.mul(value);
|
||||||
const tokenAllowance = new BigNumber('1e22');
|
const tokenAllowance = new BigNumber('1e22');
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
this.token = await SimpleToken.new({ from: tokenWallet });
|
this.token = await SimpleToken.new({ from: tokenWallet });
|
||||||
|
|||||||
@ -2,6 +2,7 @@ const expectEvent = require('../helpers/expectEvent');
|
|||||||
const { assertRevert } = require('../helpers/assertRevert');
|
const { assertRevert } = require('../helpers/assertRevert');
|
||||||
const { ether } = require('../helpers/ether');
|
const { ether } = require('../helpers/ether');
|
||||||
const { ethGetBalance } = require('../helpers/web3');
|
const { ethGetBalance } = require('../helpers/web3');
|
||||||
|
const { ZERO_ADDRESS } = require('../helpers/constants');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
|
|
||||||
@ -17,7 +18,6 @@ contract('Crowdsale', function ([_, investor, wallet, purchaser]) {
|
|||||||
const value = ether(42);
|
const value = ether(42);
|
||||||
const tokenSupply = new BigNumber('1e22');
|
const tokenSupply = new BigNumber('1e22');
|
||||||
const expectedTokenAmount = rate.mul(value);
|
const expectedTokenAmount = rate.mul(value);
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
it('requires a non-null token', async function () {
|
it('requires a non-null token', async function () {
|
||||||
await assertRevert(
|
await assertRevert(
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
const { assertRevert } = require('../helpers/assertRevert');
|
const { assertRevert } = require('../helpers/assertRevert');
|
||||||
|
const { ZERO_ADDRESS } = require('../helpers/constants');
|
||||||
const ERC20Mock = artifacts.require('ERC20Mock');
|
const ERC20Mock = artifacts.require('ERC20Mock');
|
||||||
const ERC20Mintable = artifacts.require('ERC20Mintable');
|
const ERC20Mintable = artifacts.require('ERC20Mintable');
|
||||||
const ERC20Migrator = artifacts.require('ERC20Migrator');
|
const ERC20Migrator = artifacts.require('ERC20Migrator');
|
||||||
@ -11,8 +11,6 @@ require('chai')
|
|||||||
.should();
|
.should();
|
||||||
|
|
||||||
contract('ERC20Migrator', function ([_, owner, recipient, anotherAccount]) {
|
contract('ERC20Migrator', function ([_, owner, recipient, anotherAccount]) {
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
const totalSupply = 200;
|
const totalSupply = 200;
|
||||||
|
|
||||||
it('reverts with a null legacy token address', async function () {
|
it('reverts with a null legacy token address', async function () {
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
const { decodeLogs } = require('../helpers/decodeLogs');
|
const { decodeLogs } = require('../helpers/decodeLogs');
|
||||||
|
const { ZERO_ADDRESS } = require('../helpers/constants');
|
||||||
const SimpleToken = artifacts.require('SimpleToken');
|
const SimpleToken = artifacts.require('SimpleToken');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
@ -8,8 +9,6 @@ require('chai')
|
|||||||
.should();
|
.should();
|
||||||
|
|
||||||
contract('SimpleToken', function ([_, creator]) {
|
contract('SimpleToken', function ([_, creator]) {
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
this.token = await SimpleToken.new({ from: creator });
|
this.token = await SimpleToken.new({ from: creator });
|
||||||
});
|
});
|
||||||
|
|||||||
6
test/helpers/constants.js
Normal file
6
test/helpers/constants.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
const BigNumber = web3.BigNumber;
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
ZERO_ADDRESS: '0x0000000000000000000000000000000000000000',
|
||||||
|
MAX_UINT256: new BigNumber(2).pow(256).minus(1),
|
||||||
|
};
|
||||||
@ -1,4 +1,5 @@
|
|||||||
const { assertRevert } = require('../helpers/assertRevert');
|
const { assertRevert } = require('../helpers/assertRevert');
|
||||||
|
const { MAX_UINT256 } = require('../helpers/constants');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
const SafeMathMock = artifacts.require('SafeMathMock');
|
const SafeMathMock = artifacts.require('SafeMathMock');
|
||||||
@ -8,8 +9,6 @@ require('chai')
|
|||||||
.should();
|
.should();
|
||||||
|
|
||||||
contract('SafeMath', function () {
|
contract('SafeMath', function () {
|
||||||
const MAX_UINT = new BigNumber(2).pow(256).minus(1);
|
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
this.safeMath = await SafeMathMock.new();
|
this.safeMath = await SafeMathMock.new();
|
||||||
});
|
});
|
||||||
@ -23,7 +22,7 @@ contract('SafeMath', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('throws a revert error on addition overflow', async function () {
|
it('throws a revert error on addition overflow', async function () {
|
||||||
const a = MAX_UINT;
|
const a = MAX_UINT256;
|
||||||
const b = new BigNumber(1);
|
const b = new BigNumber(1);
|
||||||
|
|
||||||
await assertRevert(this.safeMath.add(a, b));
|
await assertRevert(this.safeMath.add(a, b));
|
||||||
@ -62,7 +61,7 @@ contract('SafeMath', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('throws a revert error on multiplication overflow', async function () {
|
it('throws a revert error on multiplication overflow', async function () {
|
||||||
const a = MAX_UINT;
|
const a = MAX_UINT256;
|
||||||
const b = new BigNumber(2);
|
const b = new BigNumber(2);
|
||||||
|
|
||||||
await assertRevert(this.safeMath.mul(a, b));
|
await assertRevert(this.safeMath.mul(a, b));
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
const { expectThrow } = require('../helpers/expectThrow');
|
const { expectThrow } = require('../helpers/expectThrow');
|
||||||
const { EVMRevert } = require('../helpers/EVMRevert');
|
const { EVMRevert } = require('../helpers/EVMRevert');
|
||||||
const expectEvent = require('../helpers/expectEvent');
|
const expectEvent = require('../helpers/expectEvent');
|
||||||
|
const { ZERO_ADDRESS } = require('../helpers/constants');
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
require('chai')
|
require('chai')
|
||||||
.should();
|
.should();
|
||||||
|
|||||||
@ -1,13 +1,11 @@
|
|||||||
const { assertRevert } = require('../helpers/assertRevert');
|
const { assertRevert } = require('../helpers/assertRevert');
|
||||||
|
const { ZERO_ADDRESS } = require('../helpers/constants');
|
||||||
const SecondaryMock = artifacts.require('SecondaryMock');
|
const SecondaryMock = artifacts.require('SecondaryMock');
|
||||||
|
|
||||||
require('chai')
|
require('chai')
|
||||||
.should();
|
.should();
|
||||||
|
|
||||||
contract('Secondary', function ([_, primary, newPrimary, anyone]) {
|
contract('Secondary', function ([_, primary, newPrimary, anyone]) {
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
this.secondary = await SecondaryMock.new({ from: primary });
|
this.secondary = await SecondaryMock.new({ from: primary });
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
const { shouldBehaveLikeEscrow } = require('./Escrow.behavior');
|
const { shouldBehaveLikeEscrow } = require('./Escrow.behavior');
|
||||||
const { expectThrow } = require('../helpers/expectThrow');
|
const { expectThrow } = require('../helpers/expectThrow');
|
||||||
const { EVMRevert } = require('../helpers/EVMRevert');
|
const { EVMRevert } = require('../helpers/EVMRevert');
|
||||||
|
const { ether } = require('../helpers/ether');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ contract('ConditionalEscrow', function ([_, owner, payee, ...otherAccounts]) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
context('when withdrawal is disallowed', function () {
|
context('when withdrawal is disallowed', function () {
|
||||||
const amount = web3.toWei(23.0, 'ether');
|
const amount = ether(23.0);
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
await this.escrow.setAllowed(payee, false);
|
await this.escrow.setAllowed(payee, false);
|
||||||
|
|||||||
@ -2,6 +2,7 @@ const expectEvent = require('../helpers/expectEvent');
|
|||||||
const { expectThrow } = require('../helpers/expectThrow');
|
const { expectThrow } = require('../helpers/expectThrow');
|
||||||
const { EVMRevert } = require('../helpers/EVMRevert');
|
const { EVMRevert } = require('../helpers/EVMRevert');
|
||||||
const { ethGetBalance } = require('../helpers/web3');
|
const { ethGetBalance } = require('../helpers/web3');
|
||||||
|
const { ether } = require('../helpers/ether');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
|
|
||||||
@ -10,7 +11,7 @@ require('chai')
|
|||||||
.should();
|
.should();
|
||||||
|
|
||||||
function shouldBehaveLikeEscrow (primary, [payee1, payee2]) {
|
function shouldBehaveLikeEscrow (primary, [payee1, payee2]) {
|
||||||
const amount = web3.toWei(42.0, 'ether');
|
const amount = ether(42.0);
|
||||||
|
|
||||||
describe('as an escrow', function () {
|
describe('as an escrow', function () {
|
||||||
describe('deposits', function () {
|
describe('deposits', function () {
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
const { ethGetBalance } = require('../helpers/web3');
|
const { ethGetBalance } = require('../helpers/web3');
|
||||||
|
const { ether } = require('../helpers/ether');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
|
|
||||||
@ -9,7 +10,7 @@ require('chai')
|
|||||||
const PullPaymentMock = artifacts.require('PullPaymentMock');
|
const PullPaymentMock = artifacts.require('PullPaymentMock');
|
||||||
|
|
||||||
contract('PullPayment', function ([_, payer, payee1, payee2]) {
|
contract('PullPayment', function ([_, payer, payee1, payee2]) {
|
||||||
const amount = web3.toWei(17.0, 'ether');
|
const amount = ether(17.0);
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
this.contract = await PullPaymentMock.new({ value: amount });
|
this.contract = await PullPaymentMock.new({ value: amount });
|
||||||
|
|||||||
@ -2,6 +2,8 @@ const { expectThrow } = require('../helpers/expectThrow');
|
|||||||
const { EVMRevert } = require('../helpers/EVMRevert');
|
const { EVMRevert } = require('../helpers/EVMRevert');
|
||||||
const expectEvent = require('../helpers/expectEvent');
|
const expectEvent = require('../helpers/expectEvent');
|
||||||
const { ethGetBalance } = require('../helpers/web3');
|
const { ethGetBalance } = require('../helpers/web3');
|
||||||
|
const { ether } = require('../helpers/ether');
|
||||||
|
const { ZERO_ADDRESS } = require('../helpers/constants');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
|
|
||||||
@ -12,9 +14,8 @@ require('chai')
|
|||||||
const RefundEscrow = artifacts.require('RefundEscrow');
|
const RefundEscrow = artifacts.require('RefundEscrow');
|
||||||
|
|
||||||
contract('RefundEscrow', function ([_, primary, beneficiary, refundee1, refundee2]) {
|
contract('RefundEscrow', function ([_, primary, beneficiary, refundee1, refundee2]) {
|
||||||
const amount = web3.toWei(54.0, 'ether');
|
const amount = ether(54.0);
|
||||||
const refundees = [refundee1, refundee2];
|
const refundees = [refundee1, refundee2];
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
it('requires a non-null beneficiary', async function () {
|
it('requires a non-null beneficiary', async function () {
|
||||||
await expectThrow(
|
await expectThrow(
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
const { ethGetBalance } = require('../helpers/web3');
|
const { ethGetBalance } = require('../helpers/web3');
|
||||||
const { sendEther } = require('./../helpers/sendTransaction');
|
const { sendEther } = require('./../helpers/sendTransaction');
|
||||||
|
const { ether } = require('../helpers/ether');
|
||||||
|
const { ZERO_ADDRESS } = require('./../helpers/constants');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
|
|
||||||
@ -12,8 +14,7 @@ const { EVMRevert } = require('../helpers/EVMRevert.js');
|
|||||||
const SplitPayment = artifacts.require('SplitPayment');
|
const SplitPayment = artifacts.require('SplitPayment');
|
||||||
|
|
||||||
contract('SplitPayment', function ([_, owner, payee1, payee2, payee3, nonpayee1, payer1]) {
|
contract('SplitPayment', function ([_, owner, payee1, payee2, payee3, nonpayee1, payer1]) {
|
||||||
const amount = web3.toWei(1.0, 'ether');
|
const amount = ether(1.0);
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
it('rejects an empty set of payees', async function () {
|
it('rejects an empty set of payees', async function () {
|
||||||
await expectThrow(SplitPayment.new([], []), EVMRevert);
|
await expectThrow(SplitPayment.new([], []), EVMRevert);
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
const { assertRevert } = require('../../helpers/assertRevert');
|
const { assertRevert } = require('../../helpers/assertRevert');
|
||||||
const expectEvent = require('../../helpers/expectEvent');
|
const expectEvent = require('../../helpers/expectEvent');
|
||||||
|
const { ZERO_ADDRESS } = require('../../helpers/constants');
|
||||||
|
|
||||||
const ERC20Mock = artifacts.require('ERC20Mock');
|
const ERC20Mock = artifacts.require('ERC20Mock');
|
||||||
|
|
||||||
@ -10,8 +11,6 @@ require('chai')
|
|||||||
.should();
|
.should();
|
||||||
|
|
||||||
contract('ERC20', function ([_, owner, recipient, anotherAccount]) {
|
contract('ERC20', function ([_, owner, recipient, anotherAccount]) {
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
this.token = await ERC20Mock.new(owner, 100);
|
this.token = await ERC20Mock.new(owner, 100);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -2,6 +2,7 @@ const { expectThrow } = require('../../helpers/expectThrow');
|
|||||||
const { EVMRevert } = require('../../helpers/EVMRevert');
|
const { EVMRevert } = require('../../helpers/EVMRevert');
|
||||||
const time = require('../../helpers/time');
|
const time = require('../../helpers/time');
|
||||||
const { ethGetBlock } = require('../../helpers/web3');
|
const { ethGetBlock } = require('../../helpers/web3');
|
||||||
|
const { ZERO_ADDRESS } = require('../../helpers/constants');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
|
|
||||||
@ -14,7 +15,6 @@ const TokenVesting = artifacts.require('TokenVesting');
|
|||||||
|
|
||||||
contract('TokenVesting', function ([_, owner, beneficiary]) {
|
contract('TokenVesting', function ([_, owner, beneficiary]) {
|
||||||
const amount = new BigNumber(1000);
|
const amount = new BigNumber(1000);
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
// +1 minute so it starts after contract instantiation
|
// +1 minute so it starts after contract instantiation
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
const { assertRevert } = require('../../../helpers/assertRevert');
|
const { assertRevert } = require('../../../helpers/assertRevert');
|
||||||
const expectEvent = require('../../../helpers/expectEvent');
|
const expectEvent = require('../../../helpers/expectEvent');
|
||||||
|
const { ZERO_ADDRESS } = require('../../../helpers/constants');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
require('chai')
|
require('chai')
|
||||||
.use(require('chai-bignumber')(BigNumber))
|
.use(require('chai-bignumber')(BigNumber))
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
const { assertRevert } = require('../../../helpers/assertRevert');
|
const { assertRevert } = require('../../../helpers/assertRevert');
|
||||||
const expectEvent = require('../../../helpers/expectEvent');
|
const expectEvent = require('../../../helpers/expectEvent');
|
||||||
|
const { ZERO_ADDRESS } = require('../../../helpers/constants');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
|
|
||||||
@ -8,8 +9,6 @@ require('chai')
|
|||||||
.should();
|
.should();
|
||||||
|
|
||||||
function shouldBehaveLikeERC20Mintable (minter, [anyone]) {
|
function shouldBehaveLikeERC20Mintable (minter, [anyone]) {
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
describe('as a mintable token', function () {
|
describe('as a mintable token', function () {
|
||||||
describe('mint', function () {
|
describe('mint', function () {
|
||||||
const amount = 100;
|
const amount = 100;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
const expectEvent = require('../../helpers/expectEvent');
|
const expectEvent = require('../../helpers/expectEvent');
|
||||||
const { shouldSupportInterfaces } = require('../../introspection/SupportsInterface.behavior');
|
const { shouldSupportInterfaces } = require('../../introspection/SupportsInterface.behavior');
|
||||||
const { assertRevert } = require('../../helpers/assertRevert');
|
const { assertRevert } = require('../../helpers/assertRevert');
|
||||||
|
const { ZERO_ADDRESS } = require('../../helpers/constants');
|
||||||
const { decodeLogs } = require('../../helpers/decodeLogs');
|
const { decodeLogs } = require('../../helpers/decodeLogs');
|
||||||
const { sendTransaction } = require('../../helpers/sendTransaction');
|
const { sendTransaction } = require('../../helpers/sendTransaction');
|
||||||
|
|
||||||
@ -19,7 +20,6 @@ function shouldBehaveLikeERC721 (
|
|||||||
const firstTokenId = 1;
|
const firstTokenId = 1;
|
||||||
const secondTokenId = 2;
|
const secondTokenId = 2;
|
||||||
const unknownTokenId = 3;
|
const unknownTokenId = 3;
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
const RECEIVER_MAGIC_VALUE = '0x150b7a02';
|
const RECEIVER_MAGIC_VALUE = '0x150b7a02';
|
||||||
|
|
||||||
describe('like an ERC721', function () {
|
describe('like an ERC721', function () {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
const { assertRevert } = require('../../helpers/assertRevert');
|
const { assertRevert } = require('../../helpers/assertRevert');
|
||||||
const expectEvent = require('../../helpers/expectEvent');
|
const expectEvent = require('../../helpers/expectEvent');
|
||||||
|
const { ZERO_ADDRESS } = require('../../helpers/constants');
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
|
|
||||||
require('chai')
|
require('chai')
|
||||||
@ -15,7 +16,6 @@ function shouldBehaveLikeMintAndBurnERC721 (
|
|||||||
const secondTokenId = 2;
|
const secondTokenId = 2;
|
||||||
const thirdTokenId = 3;
|
const thirdTokenId = 3;
|
||||||
const unknownTokenId = 4;
|
const unknownTokenId = 4;
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
const MOCK_URI = 'https://example.com';
|
const MOCK_URI = 'https://example.com';
|
||||||
|
|
||||||
describe('like a mintable and burnable ERC721', function () {
|
describe('like a mintable and burnable ERC721', function () {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
const { assertRevert } = require('../../helpers/assertRevert');
|
const { assertRevert } = require('../../helpers/assertRevert');
|
||||||
const { sendTransaction } = require('../../helpers/sendTransaction');
|
const { sendTransaction } = require('../../helpers/sendTransaction');
|
||||||
|
const { ZERO_ADDRESS } = require('../../helpers/constants');
|
||||||
|
|
||||||
const BigNumber = web3.BigNumber;
|
const BigNumber = web3.BigNumber;
|
||||||
|
|
||||||
@ -11,7 +12,6 @@ function shouldBehaveLikeERC721PausedToken (owner, [recipient, operator]) {
|
|||||||
const firstTokenId = 1;
|
const firstTokenId = 1;
|
||||||
const mintedTokens = 1;
|
const mintedTokens = 1;
|
||||||
const mockData = '0x42';
|
const mockData = '0x42';
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
||||||
|
|
||||||
describe('like a paused ERC721', function () {
|
describe('like a paused ERC721', function () {
|
||||||
beforeEach(async function () {
|
beforeEach(async function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user