Bounty.js 785 B

123456789101112131415161718192021222324252627
  1. contract('Bounty', function(accounts) {
  2. it.only("can call checkInvarient for InsecureTargetMock", function(done){
  3. var bounty = Bounty.deployed();
  4. var target = SecureTargetMock.deployed();
  5. bounty.createTarget(target.address).
  6. then(function() {
  7. return bounty.checkInvarient.call()
  8. }).
  9. then(function(result) {
  10. assert.isTrue(result);
  11. }).
  12. then(done);
  13. })
  14. it("can call checkInvarient for InsecureTargetMock", function(done){
  15. var bounty = Bounty.deployed();
  16. var target = InsecureTargetMock.deployed();
  17. bounty.createTarget(target.address).
  18. then(function() {
  19. return bounty.checkInvarient.call()
  20. }).
  21. then(function(result) {
  22. assert.isFalse(result);
  23. }).
  24. then(done);
  25. })
  26. });