aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/units-and-global-variables.rst12
-rwxr-xr-xscripts/isolate_tests.py8
2 files changed, 15 insertions, 5 deletions
diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst
index e4f0ea43..7a43343f 100644
--- a/docs/units-and-global-variables.rst
+++ b/docs/units-and-global-variables.rst
@@ -128,17 +128,23 @@ Address Related
``<address>.balance`` (``uint256``):
balance of the :ref:`address` in Wei
-``<address>.send(uint256 amount) returns (bool)``:
- send given amount of Wei to :ref:`address`, returns ``false`` on failure
``<address>.transfer(uint256 amount)``:
send given amount of Wei to :ref:`address`, throws on failure
+``<address>.send(uint256 amount) returns (bool)``:
+ send given amount of Wei to :ref:`address`, returns ``false`` on failure
+``<address>.call(...) returns (bool)``:
+ issue low-level ``CALL``, returns ``false`` on failure
+``<address>.callcode(...) returns (bool)``:
+ issue low-level ``CALLCODE``, returns ``false`` on failure
+``<address>.delegatecall(...) returns (bool)``:
+ issue low-level ``DELEGATECALL``, returns ``false`` on failure
For more information, see the section on :ref:`address`.
.. warning::
There are some dangers in using ``send``: The transfer fails if the call stack depth is at 1024
(this can always be forced by the caller) and it also fails if the recipient runs out of gas. So in order
- to make safe Ether transfers, always check the return value of ``send`` or even better:
+ to make safe Ether transfers, always check the return value of ``send``, use ``transfer`` or even better:
Use a pattern where the recipient withdraws the money.
.. index:: this, selfdestruct
diff --git a/scripts/isolate_tests.py b/scripts/isolate_tests.py
index 91900aa6..9bb52f4c 100755
--- a/scripts/isolate_tests.py
+++ b/scripts/isolate_tests.py
@@ -7,23 +7,27 @@
# scripts/isolate_tests.py test/libsolidity/*
import sys
+import re
def extract_cases(path):
lines = open(path).read().splitlines()
inside = False
+ delimiter = ''
tests = []
for l in lines:
if inside:
- if l.strip().endswith(')";'):
+ if l.strip().endswith(')' + delimiter + '";'):
inside = False
else:
tests[-1] += l + '\n'
else:
- if l.strip().endswith('R"('):
+ m = re.search(r'R"([^(]*)\($', l.strip())
+ if m:
inside = True
+ delimiter = m.group(1)
tests += ['']
return tests