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:
committed by
Francisco Giordano
parent
b8a70f0e55
commit
616124e37c
@ -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 });
|
||||
});
|
||||
|
||||
@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user