Disallow structs in events without ABIEncoderV2

This commit is contained in:
Leonardo Alt
2018-09-06 17:11:53 +02:00
committed by chriseth
parent 507cdf6de2
commit c577e043a4
10 changed files with 47 additions and 0 deletions
+1
View File
@@ -1036,6 +1036,7 @@ BOOST_AUTO_TEST_CASE(return_structs_with_contracts)
BOOST_AUTO_TEST_CASE(event_structs)
{
char const* text = R"(
pragma experimental ABIEncoderV2;
contract C {
struct S { uint a; T[] sub; bytes b; }
struct T { uint[2] x; }
@@ -0,0 +1,7 @@
contract C {
function f() public {
emit;
}
}
// ----
// ParserError: (45-46): Expected event name or path.
@@ -0,0 +1,5 @@
contract c {
event E(uint[][]);
}
// ----
// TypeError: (25-33): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature.
@@ -0,0 +1,4 @@
contract c {
event E(uint[2][]);
}
// ----
@@ -0,0 +1,6 @@
contract c {
struct S { uint x; uint[][] arr; }
event E(S);
}
// ----
// TypeError: (61-62): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature.
@@ -0,0 +1,6 @@
contract c {
struct S { uint a ; }
event E(S);
}
// ----
// TypeError: (51-52): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature.
@@ -0,0 +1,6 @@
contract c {
struct S { uint a ; }
event E(S indexed);
}
// ----
// TypeError: (51-52): This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature.