* Add Mock suffix to variable names #1172
* Add Impl suffix to variable names
(cherry picked from commit 4b21fcf5af)
This commit is contained in:
@ -9,7 +9,7 @@ const should = require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
const AllowanceCrowdsale = artifacts.require('AllowanceCrowdsaleImpl');
|
||||
const AllowanceCrowdsaleImpl = artifacts.require('AllowanceCrowdsaleImpl');
|
||||
const SimpleToken = artifacts.require('SimpleToken');
|
||||
|
||||
contract('AllowanceCrowdsale', function ([_, investor, wallet, purchaser, tokenWallet]) {
|
||||
@ -20,7 +20,7 @@ contract('AllowanceCrowdsale', function ([_, investor, wallet, purchaser, tokenW
|
||||
|
||||
beforeEach(async function () {
|
||||
this.token = await SimpleToken.new({ from: tokenWallet });
|
||||
this.crowdsale = await AllowanceCrowdsale.new(rate, wallet, this.token.address, tokenWallet);
|
||||
this.crowdsale = await AllowanceCrowdsaleImpl.new(rate, wallet, this.token.address, tokenWallet);
|
||||
await this.token.approve(this.crowdsale.address, tokenAllowance, { from: tokenWallet });
|
||||
});
|
||||
|
||||
@ -73,7 +73,7 @@ contract('AllowanceCrowdsale', function ([_, investor, wallet, purchaser, tokenW
|
||||
describe('when token wallet is different from token address', function () {
|
||||
it('creation reverts', async function () {
|
||||
this.token = await SimpleToken.new({ from: tokenWallet });
|
||||
await assertRevert(AllowanceCrowdsale.new(rate, wallet, this.token.address, ZERO_ADDRESS));
|
||||
await assertRevert(AllowanceCrowdsaleImpl.new(rate, wallet, this.token.address, ZERO_ADDRESS));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -8,7 +8,7 @@ require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
const CappedCrowdsale = artifacts.require('CappedCrowdsaleImpl');
|
||||
const CappedCrowdsaleImpl = artifacts.require('CappedCrowdsaleImpl');
|
||||
const SimpleToken = artifacts.require('SimpleToken');
|
||||
|
||||
contract('CappedCrowdsale', function ([_, wallet]) {
|
||||
@ -23,14 +23,14 @@ contract('CappedCrowdsale', function ([_, wallet]) {
|
||||
|
||||
it('rejects a cap of zero', async function () {
|
||||
await expectThrow(
|
||||
CappedCrowdsale.new(rate, wallet, this.token.address, 0),
|
||||
CappedCrowdsaleImpl.new(rate, wallet, this.token.address, 0),
|
||||
EVMRevert,
|
||||
);
|
||||
});
|
||||
|
||||
context('with crowdsale', function () {
|
||||
beforeEach(async function () {
|
||||
this.crowdsale = await CappedCrowdsale.new(rate, wallet, this.token.address, cap);
|
||||
this.crowdsale = await CappedCrowdsaleImpl.new(rate, wallet, this.token.address, cap);
|
||||
await this.token.transfer(this.crowdsale.address, tokenSupply);
|
||||
});
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ const should = require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
const FinalizableCrowdsale = artifacts.require('FinalizableCrowdsaleImpl');
|
||||
const FinalizableCrowdsaleImpl = artifacts.require('FinalizableCrowdsaleImpl');
|
||||
const ERC20 = artifacts.require('ERC20');
|
||||
|
||||
contract('FinalizableCrowdsale', function ([_, wallet, anyone]) {
|
||||
@ -27,7 +27,7 @@ contract('FinalizableCrowdsale', function ([_, wallet, anyone]) {
|
||||
this.afterClosingTime = this.closingTime + duration.seconds(1);
|
||||
|
||||
this.token = await ERC20.new();
|
||||
this.crowdsale = await FinalizableCrowdsale.new(
|
||||
this.crowdsale = await FinalizableCrowdsaleImpl.new(
|
||||
this.openingTime, this.closingTime, rate, wallet, this.token.address
|
||||
);
|
||||
});
|
||||
|
||||
@ -10,7 +10,7 @@ require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
const IncreasingPriceCrowdsale = artifacts.require('IncreasingPriceCrowdsaleImpl');
|
||||
const IncreasingPriceCrowdsaleImpl = artifacts.require('IncreasingPriceCrowdsaleImpl');
|
||||
const SimpleToken = artifacts.require('SimpleToken');
|
||||
|
||||
contract('IncreasingPriceCrowdsale', function ([_, investor, wallet, purchaser]) {
|
||||
@ -36,20 +36,20 @@ contract('IncreasingPriceCrowdsale', function ([_, investor, wallet, purchaser])
|
||||
});
|
||||
|
||||
it('rejects a final rate larger than the initial rate', async function () {
|
||||
await assertRevert(IncreasingPriceCrowdsale.new(
|
||||
await assertRevert(IncreasingPriceCrowdsaleImpl.new(
|
||||
this.startTime, this.closingTime, wallet, this.token.address, initialRate, initialRate.plus(1)
|
||||
));
|
||||
});
|
||||
|
||||
it('rejects a final rate of zero', async function () {
|
||||
await assertRevert(IncreasingPriceCrowdsale.new(
|
||||
await assertRevert(IncreasingPriceCrowdsaleImpl.new(
|
||||
this.startTime, this.closingTime, wallet, this.token.address, initialRate, 0
|
||||
));
|
||||
});
|
||||
|
||||
context('with crowdsale', function () {
|
||||
beforeEach(async function () {
|
||||
this.crowdsale = await IncreasingPriceCrowdsale.new(
|
||||
this.crowdsale = await IncreasingPriceCrowdsaleImpl.new(
|
||||
this.startTime, this.closingTime, wallet, this.token.address, initialRate, finalRate
|
||||
);
|
||||
await this.token.transfer(this.crowdsale.address, tokenSupply);
|
||||
|
||||
@ -4,7 +4,7 @@ const { assertRevert } = require('../helpers/assertRevert');
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
|
||||
const MintedCrowdsale = artifacts.require('MintedCrowdsaleImpl');
|
||||
const MintedCrowdsaleImpl = artifacts.require('MintedCrowdsaleImpl');
|
||||
const ERC20Mintable = artifacts.require('ERC20Mintable');
|
||||
const ERC20 = artifacts.require('ERC20');
|
||||
|
||||
@ -15,7 +15,7 @@ contract('MintedCrowdsale', function ([_, deployer, investor, wallet, purchaser]
|
||||
describe('using ERC20Mintable', function () {
|
||||
beforeEach(async function () {
|
||||
this.token = await ERC20Mintable.new({ from: deployer });
|
||||
this.crowdsale = await MintedCrowdsale.new(rate, wallet, this.token.address);
|
||||
this.crowdsale = await MintedCrowdsaleImpl.new(rate, wallet, this.token.address);
|
||||
|
||||
await this.token.addMinter(this.crowdsale.address, { from: deployer });
|
||||
await this.token.renounceMinter({ from: deployer });
|
||||
@ -31,7 +31,7 @@ contract('MintedCrowdsale', function ([_, deployer, investor, wallet, purchaser]
|
||||
describe('using non-mintable token', function () {
|
||||
beforeEach(async function () {
|
||||
this.token = await ERC20.new();
|
||||
this.crowdsale = await MintedCrowdsale.new(rate, wallet, this.token.address);
|
||||
this.crowdsale = await MintedCrowdsaleImpl.new(rate, wallet, this.token.address);
|
||||
});
|
||||
|
||||
it('rejects bare payments', async function () {
|
||||
|
||||
@ -11,7 +11,7 @@ require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
const PostDeliveryCrowdsale = artifacts.require('PostDeliveryCrowdsaleImpl');
|
||||
const PostDeliveryCrowdsaleImpl = artifacts.require('PostDeliveryCrowdsaleImpl');
|
||||
const SimpleToken = artifacts.require('SimpleToken');
|
||||
|
||||
contract('PostDeliveryCrowdsale', function ([_, investor, wallet, purchaser]) {
|
||||
@ -28,7 +28,7 @@ contract('PostDeliveryCrowdsale', function ([_, investor, wallet, purchaser]) {
|
||||
this.closingTime = this.openingTime + duration.weeks(1);
|
||||
this.afterClosingTime = this.closingTime + duration.seconds(1);
|
||||
this.token = await SimpleToken.new();
|
||||
this.crowdsale = await PostDeliveryCrowdsale.new(
|
||||
this.crowdsale = await PostDeliveryCrowdsaleImpl.new(
|
||||
this.openingTime, this.closingTime, rate, wallet, this.token.address
|
||||
);
|
||||
await this.token.transfer(this.crowdsale.address, tokenSupply);
|
||||
|
||||
@ -12,7 +12,7 @@ require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
const RefundableCrowdsale = artifacts.require('RefundableCrowdsaleImpl');
|
||||
const RefundableCrowdsaleImpl = artifacts.require('RefundableCrowdsaleImpl');
|
||||
const SimpleToken = artifacts.require('SimpleToken');
|
||||
|
||||
contract('RefundableCrowdsale', function ([_, wallet, investor, purchaser, anyone]) {
|
||||
@ -37,7 +37,7 @@ contract('RefundableCrowdsale', function ([_, wallet, investor, purchaser, anyon
|
||||
|
||||
it('rejects a goal of zero', async function () {
|
||||
await expectThrow(
|
||||
RefundableCrowdsale.new(
|
||||
RefundableCrowdsaleImpl.new(
|
||||
this.openingTime, this.closingTime, rate, wallet, this.token.address, 0,
|
||||
),
|
||||
EVMRevert,
|
||||
@ -46,7 +46,7 @@ contract('RefundableCrowdsale', function ([_, wallet, investor, purchaser, anyon
|
||||
|
||||
context('with crowdsale', function () {
|
||||
beforeEach(async function () {
|
||||
this.crowdsale = await RefundableCrowdsale.new(
|
||||
this.crowdsale = await RefundableCrowdsaleImpl.new(
|
||||
this.openingTime, this.closingTime, rate, wallet, this.token.address, goal
|
||||
);
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
const TimedCrowdsale = artifacts.require('TimedCrowdsaleImpl');
|
||||
const TimedCrowdsaleImpl = artifacts.require('TimedCrowdsaleImpl');
|
||||
const SimpleToken = artifacts.require('SimpleToken');
|
||||
|
||||
contract('TimedCrowdsale', function ([_, investor, wallet, purchaser]) {
|
||||
@ -32,20 +32,22 @@ contract('TimedCrowdsale', function ([_, investor, wallet, purchaser]) {
|
||||
});
|
||||
|
||||
it('rejects an opening time in the past', async function () {
|
||||
await expectThrow(TimedCrowdsale.new(
|
||||
await expectThrow(TimedCrowdsaleImpl.new(
|
||||
(await latestTime()) - duration.days(1), this.closingTime, rate, wallet, this.token.address
|
||||
), EVMRevert);
|
||||
});
|
||||
|
||||
it('rejects a closing time before the opening time', async function () {
|
||||
await expectThrow(TimedCrowdsale.new(
|
||||
await expectThrow(TimedCrowdsaleImpl.new(
|
||||
this.openingTime, this.openingTime - duration.seconds(1), rate, wallet, this.token.address
|
||||
), EVMRevert);
|
||||
});
|
||||
|
||||
context('with crowdsale', function () {
|
||||
beforeEach(async function () {
|
||||
this.crowdsale = await TimedCrowdsale.new(this.openingTime, this.closingTime, rate, wallet, this.token.address);
|
||||
this.crowdsale = await TimedCrowdsaleImpl.new(
|
||||
this.openingTime, this.closingTime, rate, wallet, this.token.address
|
||||
);
|
||||
await this.token.transfer(this.crowdsale.address, tokenSupply);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user