aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-01-03 21:11:41 +0800
committerGitHub <noreply@github.com>2017-01-03 21:11:41 +0800
commitc8ba7f5278c2d11454cc05089014bb525b46ee60 (patch)
tree4605f5c5ea5aa756e7f802ae9ef162debeae783b /test/libsolidity/SolidityEndToEndTest.cpp
parent50c1cfa348fab97c8d5f18303776fc82c88f657d (diff)
parent6a312233fcbaf9b7ec7b7088719a3be724ea228b (diff)
downloaddexon-solidity-c8ba7f5278c2d11454cc05089014bb525b46ee60.tar
dexon-solidity-c8ba7f5278c2d11454cc05089014bb525b46ee60.tar.gz
dexon-solidity-c8ba7f5278c2d11454cc05089014bb525b46ee60.tar.bz2
dexon-solidity-c8ba7f5278c2d11454cc05089014bb525b46ee60.tar.lz
dexon-solidity-c8ba7f5278c2d11454cc05089014bb525b46ee60.tar.xz
dexon-solidity-c8ba7f5278c2d11454cc05089014bb525b46ee60.tar.zst
dexon-solidity-c8ba7f5278c2d11454cc05089014bb525b46ee60.zip
Merge pull request #1474 from ethereum/event-lookup-base-name
Event lookup with base name
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 94d4fb7f..d8539524 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -2770,6 +2770,28 @@ BOOST_AUTO_TEST_CASE(event_no_arguments)
BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::keccak256(string("Deposit()")));
}
+BOOST_AUTO_TEST_CASE(event_access_through_base_name)
+{
+ char const* sourceCode = R"(
+ contract A {
+ event x();
+ }
+ contract B is A {
+ function f() returns (uint) {
+ A.x();
+ return 1;
+ }
+ }
+ )";
+ compileAndRun(sourceCode);
+ callContractFunction("f()");
+ BOOST_REQUIRE_EQUAL(m_logs.size(), 1);
+ BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress);
+ BOOST_CHECK(m_logs[0].data.empty());
+ BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 1);
+ BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::keccak256(string("x()")));
+}
+
BOOST_AUTO_TEST_CASE(event_anonymous)
{
char const* sourceCode = R"(