aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-03-14 00:18:21 +0800
committerchriseth <chris@ethereum.org>2018-03-14 00:18:46 +0800
commiteecc26deec1815191bc3405e54ef84daaba853a1 (patch)
treefee544ac1ab5b49de54366f81ef1f8beb9727dde /test/libsolidity/SolidityEndToEndTest.cpp
parent8ad0fb3be3998cf509c6329f41428fcd8d0d7de5 (diff)
downloaddexon-solidity-eecc26deec1815191bc3405e54ef84daaba853a1.tar
dexon-solidity-eecc26deec1815191bc3405e54ef84daaba853a1.tar.gz
dexon-solidity-eecc26deec1815191bc3405e54ef84daaba853a1.tar.bz2
dexon-solidity-eecc26deec1815191bc3405e54ef84daaba853a1.tar.lz
dexon-solidity-eecc26deec1815191bc3405e54ef84daaba853a1.tar.xz
dexon-solidity-eecc26deec1815191bc3405e54ef84daaba853a1.tar.zst
dexon-solidity-eecc26deec1815191bc3405e54ef84daaba853a1.zip
Make external library functions accessible.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 33cd1419..d8c8b8ad 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -6955,6 +6955,21 @@ BOOST_AUTO_TEST_CASE(library_call)
ABI_CHECK(callContractFunction("f(uint256)", u256(33)), encodeArgs(u256(33) * 9));
}
+BOOST_AUTO_TEST_CASE(library_function_external)
+{
+ char const* sourceCode = R"(
+ library Lib { function m(bytes b) external pure returns (byte) { return b[2]; } }
+ contract Test {
+ function f(bytes b) public pure returns (byte) {
+ return Lib.m(b);
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "Lib");
+ compileAndRun(sourceCode, 0, "Test", bytes(), map<string, Address>{{"Lib", m_contractAddress}});
+ ABI_CHECK(callContractFunction("f(bytes)", u256(0x20), u256(5), "abcde"), encodeArgs("c"));
+}
+
BOOST_AUTO_TEST_CASE(library_stray_values)
{
char const* sourceCode = R"(