committed by
Francisco Giordano
parent
0541347034
commit
4d7c3cca75
@ -29,9 +29,9 @@ contract('CappedCrowdsale', function ([_, wallet]) {
|
||||
this.startTime = latestTime() + duration.weeks(1);
|
||||
this.endTime = this.startTime + duration.weeks(1);
|
||||
|
||||
this.crowdsale = await CappedCrowdsale.new(this.startTime, this.endTime, rate, wallet, cap);
|
||||
|
||||
this.token = MintableToken.at(await this.crowdsale.token());
|
||||
this.token = await MintableToken.new();
|
||||
this.crowdsale = await CappedCrowdsale.new(this.startTime, this.endTime, rate, wallet, cap, this.token.address);
|
||||
await this.token.transferOwnership(this.crowdsale.address);
|
||||
});
|
||||
|
||||
describe('creating a valid crowdsale', function () {
|
||||
|
||||
@ -30,9 +30,9 @@ contract('Crowdsale', function ([_, investor, wallet, purchaser]) {
|
||||
this.endTime = this.startTime + duration.weeks(1);
|
||||
this.afterEndTime = this.endTime + duration.seconds(1);
|
||||
|
||||
this.crowdsale = await Crowdsale.new(this.startTime, this.endTime, rate, wallet);
|
||||
|
||||
this.token = MintableToken.at(await this.crowdsale.token());
|
||||
this.token = await MintableToken.new();
|
||||
this.crowdsale = await Crowdsale.new(this.startTime, this.endTime, rate, wallet, this.token.address);
|
||||
await this.token.transferOwnership(this.crowdsale.address);
|
||||
});
|
||||
|
||||
it('should be token owner', async function () {
|
||||
|
||||
@ -26,9 +26,11 @@ contract('FinalizableCrowdsale', function ([_, owner, wallet, thirdparty]) {
|
||||
this.endTime = this.startTime + duration.weeks(1);
|
||||
this.afterEndTime = this.endTime + duration.seconds(1);
|
||||
|
||||
this.crowdsale = await FinalizableCrowdsale.new(this.startTime, this.endTime, rate, wallet, { from: owner });
|
||||
|
||||
this.token = MintableToken.at(await this.crowdsale.token());
|
||||
this.token = await MintableToken.new();
|
||||
this.crowdsale = await FinalizableCrowdsale.new(
|
||||
this.startTime, this.endTime, rate, wallet, this.token.address, { from: owner }
|
||||
);
|
||||
await this.token.transferOwnership(this.crowdsale.address);
|
||||
});
|
||||
|
||||
it('cannot be finalized before ending', async function () {
|
||||
|
||||
@ -12,6 +12,7 @@ require('chai')
|
||||
.should();
|
||||
|
||||
const RefundableCrowdsale = artifacts.require('mocks/RefundableCrowdsaleImpl.sol');
|
||||
const MintableToken = artifacts.require('MintableToken');
|
||||
|
||||
contract('RefundableCrowdsale', function ([_, owner, wallet, investor]) {
|
||||
const rate = new BigNumber(1000);
|
||||
@ -28,7 +29,11 @@ contract('RefundableCrowdsale', function ([_, owner, wallet, investor]) {
|
||||
this.endTime = this.startTime + duration.weeks(1);
|
||||
this.afterEndTime = this.endTime + duration.seconds(1);
|
||||
|
||||
this.crowdsale = await RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, goal, { from: owner });
|
||||
this.token = await MintableToken.new();
|
||||
this.crowdsale = await RefundableCrowdsale.new(
|
||||
this.startTime, this.endTime, rate, wallet, goal, this.token.address, { from: owner }
|
||||
);
|
||||
await this.token.transferOwnership(this.crowdsale.address);
|
||||
});
|
||||
|
||||
describe('creating a valid crowdsale', function () {
|
||||
|
||||
@ -29,8 +29,11 @@ contract('SampleCrowdsale', function ([owner, wallet, investor]) {
|
||||
this.endTime = this.startTime + duration.weeks(1);
|
||||
this.afterEndTime = this.endTime + duration.seconds(1);
|
||||
|
||||
this.crowdsale = await SampleCrowdsale.new(this.startTime, this.endTime, RATE, GOAL, CAP, wallet);
|
||||
this.token = SampleCrowdsaleToken.at(await this.crowdsale.token());
|
||||
this.token = await SampleCrowdsaleToken.new();
|
||||
this.crowdsale = await SampleCrowdsale.new(
|
||||
this.startTime, this.endTime, RATE, GOAL, CAP, wallet, this.token.address
|
||||
);
|
||||
await this.token.transferOwnership(this.crowdsale.address);
|
||||
});
|
||||
|
||||
it('should create crowdsale with correct parameters', async function () {
|
||||
|
||||
Reference in New Issue
Block a user