mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
test: add a test case for #1286
This commit is contained in:
parent
e079b1c53f
commit
96ca706353
@ -2770,6 +2770,28 @@ BOOST_AUTO_TEST_CASE(event_no_arguments)
|
|||||||
BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::keccak256(string("Deposit()")));
|
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)
|
BOOST_AUTO_TEST_CASE(event_anonymous)
|
||||||
{
|
{
|
||||||
char const* sourceCode = R"(
|
char const* sourceCode = R"(
|
||||||
|
Loading…
Reference in New Issue
Block a user