aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-07-16 22:25:22 +0800
committerGitHub <noreply@github.com>2018-07-16 22:25:22 +0800
commit29dae15c50277d52087f2eddea7d2033754e2c1f (patch)
tree321fa187d152510403c005b0c44738453f6c8539 /test/libsolidity/SolidityEndToEndTest.cpp
parentb38c26bb0cbbb7fe80c99fc757cb6150c61a56b4 (diff)
parentbdac82ecdbb6a4d27e9c5b11ce48d2d653a652e6 (diff)
downloaddexon-solidity-29dae15c50277d52087f2eddea7d2033754e2c1f.tar
dexon-solidity-29dae15c50277d52087f2eddea7d2033754e2c1f.tar.gz
dexon-solidity-29dae15c50277d52087f2eddea7d2033754e2c1f.tar.bz2
dexon-solidity-29dae15c50277d52087f2eddea7d2033754e2c1f.tar.lz
dexon-solidity-29dae15c50277d52087f2eddea7d2033754e2c1f.tar.xz
dexon-solidity-29dae15c50277d52087f2eddea7d2033754e2c1f.tar.zst
dexon-solidity-29dae15c50277d52087f2eddea7d2033754e2c1f.zip
Merge pull request #4481 from ethereum/disallow-throw
[BREAKING] Deprecate the throw statement
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index ba6e864a..0fe21c4a 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -2095,7 +2095,7 @@ BOOST_AUTO_TEST_CASE(transfer_ether)
contract C {
function () external payable {
- throw;
+ revert();
}
}
)";
@@ -7741,7 +7741,7 @@ BOOST_AUTO_TEST_CASE(simple_throw)
if (x > 10)
return x + 10;
else
- throw;
+ revert();
return 2;
}
}
@@ -9603,7 +9603,7 @@ BOOST_AUTO_TEST_CASE(mutex)
contract mutexed {
bool locked;
modifier protected {
- if (locked) throw;
+ if (locked) revert();
locked = true;
_;
locked = false;
@@ -9615,16 +9615,16 @@ BOOST_AUTO_TEST_CASE(mutex)
function withdraw(uint amount) public protected returns (uint) {
// NOTE: It is very bad practice to write this function this way.
// Please refer to the documentation of how to do this properly.
- if (amount > shares) throw;
- if (!msg.sender.call.value(amount)("")) throw;
+ if (amount > shares) revert();
+ if (!msg.sender.call.value(amount)("")) revert();
shares -= amount;
return shares;
}
function withdrawUnprotected(uint amount) public returns (uint) {
// NOTE: It is very bad practice to write this function this way.
// Please refer to the documentation of how to do this properly.
- if (amount > shares) throw;
- if (!msg.sender.call.value(amount)("")) throw;
+ if (amount > shares) revert();
+ if (!msg.sender.call.value(amount)("")) revert();
shares -= amount;
return shares;
}
@@ -11159,7 +11159,7 @@ BOOST_AUTO_TEST_CASE(inline_assembly_in_modifiers)
a := 2
}
if (a != 2)
- throw;
+ revert();
_;
}
function f() m public returns (bool) {