Update modifiers to call public view functions (#1277)

* Update modifiers to call public view functions.

Fixes #1179.

* remove isMinter

* fix is owner call

* fix isOpen

* Remove unnecessary solium disable
This commit is contained in:
Leo Arias
2018-09-06 08:38:29 -06:00
committed by Francisco Giordano
parent b8a70f0e55
commit 616124e37c
6 changed files with 35 additions and 10 deletions

View File

@ -52,17 +52,20 @@ contract('TimedCrowdsale', function ([_, investor, wallet, purchaser]) {
it('should be ended only after end', async function () {
(await this.crowdsale.hasClosed()).should.equal(false);
await increaseTimeTo(this.afterClosingTime);
(await this.crowdsale.isOpen()).should.equal(false);
(await this.crowdsale.hasClosed()).should.equal(true);
});
describe('accepting payments', function () {
it('should reject payments before start', async function () {
(await this.crowdsale.isOpen()).should.equal(false);
await expectThrow(this.crowdsale.send(value), EVMRevert);
await expectThrow(this.crowdsale.buyTokens(investor, { from: purchaser, value: value }), EVMRevert);
});
it('should accept payments after start', async function () {
await increaseTimeTo(this.openingTime);
(await this.crowdsale.isOpen()).should.equal(true);
await this.crowdsale.send(value);
await this.crowdsale.buyTokens(investor, { value: value, from: purchaser });
});

View File

@ -13,8 +13,11 @@ function shouldBehaveLikeOwnable (owner, [anyone]) {
});
it('changes owner after transfer', async function () {
(await this.ownable.isOwner({ from: anyone })).should.be.equal(false);
await this.ownable.transferOwnership(anyone, { from: owner });
(await this.ownable.owner()).should.equal(anyone);
(await this.ownable.isOwner({ from: anyone })).should.be.equal(true);
});
it('should prevent non-owners from transfering', async function () {