Does not allow to create bounty contract without address
This commit is contained in:
@ -28,7 +28,12 @@ contract Bounty is PullPayment, Killable {
|
||||
if (claimed) throw;
|
||||
}
|
||||
|
||||
function Bounty(address _factoryAddress){
|
||||
modifier withAddress(address _address) {
|
||||
if(_address == 0) throw;
|
||||
_;
|
||||
}
|
||||
|
||||
function Bounty(address _factoryAddress) withAddress(_factoryAddress){
|
||||
factoryAddress = _factoryAddress;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@ module.exports = function(deployer) {
|
||||
deployer.deploy(PullPaymentBid);
|
||||
deployer.deploy(BadArrayUse);
|
||||
deployer.deploy(ProofOfExistence);
|
||||
deployer.deploy(Bounty);
|
||||
deployer.deploy(CrowdsaleTokenBounty);
|
||||
deployer.deploy(Ownable);
|
||||
deployer.deploy(LimitFunds);
|
||||
|
||||
@ -33,6 +33,18 @@ contract('Bounty', function(accounts) {
|
||||
then(done);
|
||||
})
|
||||
|
||||
it("cannot create bounty without address", function(done){
|
||||
var target = SecureTargetMock.deployed();
|
||||
Bounty.new().
|
||||
then(function(bounty){
|
||||
throw {name : "NoThrowError", message : "should not come here"};
|
||||
}).
|
||||
catch(function(error){
|
||||
assert.notEqual(error.name, "NoThrowError");
|
||||
}).
|
||||
then(done);
|
||||
})
|
||||
|
||||
it("empties itself when killed", function(done){
|
||||
var target = SecureTargetMock.deployed();
|
||||
var owner = accounts[0];
|
||||
|
||||
Reference in New Issue
Block a user