Browse Source

Add bounty test to test against checkInvarient

Makoto Inoue 9 years ago
parent
commit
a98c5b8865
2 changed files with 18 additions and 0 deletions
  1. 4 0
      contracts/Bounty.sol
  2. 14 0
      test/Bounty.js

+ 4 - 0
contracts/Bounty.sol

@@ -23,6 +23,10 @@ contract Bounty is PullPayment {
     return target;
     return target;
   }
   }
 
 
+  function checkInvarient() returns(bool){
+    return true;
+  }
+
   function claim(SimpleToken target) {
   function claim(SimpleToken target) {
     address researcher = researchers[target];
     address researcher = researchers[target];
     if (researcher == 0) throw;
     if (researcher == 0) throw;

+ 14 - 0
test/Bounty.js

@@ -0,0 +1,14 @@
+contract('Bounty', function(accounts) {
+  it.only("create target", function(done){
+    var bounty = Bounty.deployed();
+
+    bounty.createTarget().
+      then(function() {
+        return bounty.checkInvarient.call()
+      }).
+      then(function(result) {
+        assert.isTrue(result);
+      }).
+      then(done);
+  })
+});