Disallow structs in events without ABIEncoderV2

This commit is contained in:
Leonardo Alt
2018-08-03 13:41:27 +02:00
parent da6cefd475
commit 20c6cea7bb
10 changed files with 39 additions and 0 deletions
+1
View File
@@ -980,6 +980,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,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.