aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 2bf20126..f058458d 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -10528,11 +10528,18 @@ BOOST_AUTO_TEST_CASE(non_payable_throw)
contract C {
uint public a;
function f() public returns (uint) {
+ return msgvalue();
+ }
+ function msgvalue() internal returns (uint) {
return msg.value;
}
function() external {
+ update();
+ }
+ function update() internal {
a = msg.value + 1;
}
+
}
)";
compileAndRun(sourceCode, 0, "C");
@@ -10555,6 +10562,9 @@ BOOST_AUTO_TEST_CASE(no_nonpayable_circumvention_by_modifier)
if (false) _; // avoid the function, we should still not accept ether
}
function f() tryCircumvent public returns (uint) {
+ return msgvalue();
+ }
+ function msgvalue() internal returns (uint) {
return msg.value;
}
}