test: add a test case for #1286

This commit is contained in:
Yoichi Hirai 2016-12-02 12:03:39 +01:00
parent e079b1c53f
commit 96ca706353
No known key found for this signature in database
GPG Key ID: E7B75D080FCF7992

View File

@ -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"(