sanity check for CappedCrowdsale: cap > 0
This commit is contained in:
committed by
Francisco Giordano
parent
6035bd522b
commit
db40fd314a
@ -13,6 +13,7 @@ contract CappedCrowdsale is Crowdsale {
|
||||
uint256 public cap;
|
||||
|
||||
function CappedCrowdsale(uint256 _cap) {
|
||||
require(_cap > 0);
|
||||
cap = _cap;
|
||||
}
|
||||
|
||||
|
||||
@ -19,6 +19,15 @@ contract('CappedCrowdsale', function ([_, wallet]) {
|
||||
const cap = ether(300)
|
||||
const lessThanCap = ether(60)
|
||||
|
||||
describe('creating a valid crowdsale', function () {
|
||||
|
||||
it('should fail with zero cap', async function () {
|
||||
await CappedCrowdsale.new(this.startBlock, this.endBlock, rate, wallet, 0).should.be.rejectedWith(EVMThrow);
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
|
||||
beforeEach(async function () {
|
||||
this.startBlock = web3.eth.blockNumber + 10
|
||||
this.endBlock = web3.eth.blockNumber + 20
|
||||
|
||||
Reference in New Issue
Block a user