Swap target contract at test by using abstract interface
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
contract('Bounty', function(accounts) {
|
||||
it.only("create target", function(done){
|
||||
it.only("can call checkInvarient for InsecureTargetMock", function(done){
|
||||
var bounty = Bounty.deployed();
|
||||
|
||||
bounty.createTarget().
|
||||
var target = SecureTargetMock.deployed();
|
||||
bounty.createTarget(target.address).
|
||||
then(function() {
|
||||
return bounty.checkInvarient.call()
|
||||
}).
|
||||
@ -11,4 +11,17 @@ contract('Bounty', function(accounts) {
|
||||
}).
|
||||
then(done);
|
||||
})
|
||||
|
||||
it("can call checkInvarient for InsecureTargetMock", function(done){
|
||||
var bounty = Bounty.deployed();
|
||||
var target = InsecureTargetMock.deployed();
|
||||
bounty.createTarget(target.address).
|
||||
then(function() {
|
||||
return bounty.checkInvarient.call()
|
||||
}).
|
||||
then(function(result) {
|
||||
assert.isFalse(result);
|
||||
}).
|
||||
then(done);
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user