Browse Source

Replace deprecated throw with assert in Solidity tests

Tal Ater 8 years ago
parent
commit
1d54b86a7c
2 changed files with 2 additions and 6 deletions
  1. 1 3
      test/helpers/ReentrancyAttack.sol
  2. 1 3
      test/helpers/ReentrancyMock.sol

+ 1 - 3
test/helpers/ReentrancyAttack.sol

@@ -3,9 +3,7 @@ pragma solidity ^0.4.11;
 contract ReentrancyAttack {
 
   function callSender(bytes4 data) {
-    if(!msg.sender.call(data)) {
-      throw;
-    }
+    assert(msg.sender.call(data));
   }
 
 }

+ 1 - 3
test/helpers/ReentrancyMock.sol

@@ -27,9 +27,7 @@ contract ReentrancyMock is ReentrancyGuard {
     if(n > 0) {
       count();
       bool result = this.call(func, n - 1);
-      if(result != true) {
-        throw;
-      }
+      assert(result == true);
     }
   }