Makoto Inoue 9 years ago
parent
commit
334073a64f

+ 4 - 4
contracts/Bounty.sol

@@ -9,7 +9,7 @@ import './PullPayment.sol';
  */
 
 contract Target {
-  function checkInvarient() returns(bool);
+  function checkInvariant() returns(bool);
 }
 
 contract Bounty is PullPayment {
@@ -27,15 +27,15 @@ contract Bounty is PullPayment {
     return target;
   }
 
-  function checkInvarient() returns(bool){
-    return target.checkInvarient();
+  function checkInvariant() returns(bool){
+    return target.checkInvariant();
   }
 
   function claim(Target target) {
     address researcher = researchers[target];
     if (researcher == 0) throw;
     // Check Target contract invariants
-    if (!target.checkInvarient()) {
+    if (!target.checkInvariant()) {
       throw;
     }
     asyncSend(researcher, this.balance);

+ 1 - 1
contracts/test-helpers/InsecureTargetMock.sol

@@ -1,7 +1,7 @@
 pragma solidity ^0.4.0;
 
 contract InsecureTargetMock {
-  function checkInvarient() returns(bool){
+  function checkInvariant() returns(bool){
     return false;
   }
 }

+ 1 - 1
contracts/test-helpers/SecureTargetMock.sol

@@ -1,7 +1,7 @@
 pragma solidity ^0.4.0;
 
 contract SecureTargetMock {
-  function checkInvarient() returns(bool){
+  function checkInvariant() returns(bool){
     return true;
   }
 }

+ 4 - 4
test/Bounty.js

@@ -1,10 +1,10 @@
 contract('Bounty', function(accounts) {
-  it("can call checkInvarient for InsecureTargetMock", function(done){
+  it("can call checkInvariant for InsecureTargetMock", function(done){
     var bounty = Bounty.deployed();
     var target = SecureTargetMock.deployed();
     bounty.createTarget(target.address).
       then(function() {
-        return bounty.checkInvarient.call()
+        return bounty.checkInvariant.call()
       }).
       then(function(result) {
         assert.isTrue(result);
@@ -12,12 +12,12 @@ contract('Bounty', function(accounts) {
       then(done);
   })
 
-  it("can call checkInvarient for InsecureTargetMock", function(done){
+  it("can call checkInvariant for InsecureTargetMock", function(done){
     var bounty = Bounty.deployed();
     var target = InsecureTargetMock.deployed();
     bounty.createTarget(target.address).
       then(function() {
-        return bounty.checkInvarient.call()
+        return bounty.checkInvariant.call()
       }).
       then(function(result) {
         assert.isFalse(result);