IncPriceCrowdsale consistently returns 0 outside of the crowdsale window. (#1442)

This commit is contained in:
Nicolás Venturo
2018-10-18 16:36:27 -03:00
committed by GitHub
parent 1c5f16ae26
commit 9155bfe27f
2 changed files with 13 additions and 0 deletions

View File

@ -59,6 +59,15 @@ contract('IncreasingPriceCrowdsale', function ([_, investor, wallet, purchaser])
(await this.crowdsale.finalRate()).should.be.bignumber.equal(finalRate);
});
it('returns a rate of 0 before the crowdsale starts', async function () {
(await this.crowdsale.getCurrentRate()).should.be.bignumber.equal(0);
});
it('returns a rate of 0 after the crowdsale ends', async function () {
await time.increaseTo(this.afterClosingTime);
(await this.crowdsale.getCurrentRate()).should.be.bignumber.equal(0);
});
it('at start', async function () {
await time.increaseTo(this.startTime);
await this.crowdsale.buyTokens(investor, { value, from: purchaser });