From 1d54b86a7c7d919957e68f65b227ddedaadd4a81 Mon Sep 17 00:00:00 2001 From: Tal Ater Date: Tue, 17 Oct 2017 21:02:47 +0300 Subject: [PATCH] Replace deprecated throw with assert in Solidity tests --- test/helpers/ReentrancyAttack.sol | 4 +--- test/helpers/ReentrancyMock.sol | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/test/helpers/ReentrancyAttack.sol b/test/helpers/ReentrancyAttack.sol index 7eac47820..14458144f 100644 --- a/test/helpers/ReentrancyAttack.sol +++ b/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)); } } diff --git a/test/helpers/ReentrancyMock.sol b/test/helpers/ReentrancyMock.sol index 411e72197..178b14cf1 100644 --- a/test/helpers/ReentrancyMock.sol +++ b/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); } }