aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityABIJSON.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SolidityABIJSON.cpp')
-rw-r--r--SolidityABIJSON.cpp34
1 files changed, 29 insertions, 5 deletions
diff --git a/SolidityABIJSON.cpp b/SolidityABIJSON.cpp
index 5f67a566..bbe5fd8c 100644
--- a/SolidityABIJSON.cpp
+++ b/SolidityABIJSON.cpp
@@ -19,6 +19,7 @@
* @date 2014
* Unit tests for the solidity compiler JSON Interface output.
*/
+#if ETH_SOLIDITY
#include "TestHelper.h"
#include <libsolidity/CompilerStack.h>
@@ -309,6 +310,7 @@ BOOST_AUTO_TEST_CASE(events)
{
"name": "e1",
"type": "event",
+ "anonymous": false,
"inputs": [
{
"indexed": false,
@@ -325,6 +327,7 @@ BOOST_AUTO_TEST_CASE(events)
{
"name": "e2",
"type": "event",
+ "anonymous": false,
"inputs": []
}
@@ -333,16 +336,33 @@ BOOST_AUTO_TEST_CASE(events)
checkInterface(sourceCode, interface);
}
+BOOST_AUTO_TEST_CASE(events_anonymous)
+{
+ char const* sourceCode = "contract test {\n"
+ " event e() anonymous; \n"
+ "}\n";
+ char const* interface = R"([
+ {
+ "name": "e",
+ "type": "event",
+ "anonymous": true,
+ "inputs": []
+ }
+
+ ])";
+
+ checkInterface(sourceCode, interface);
+}
BOOST_AUTO_TEST_CASE(inherited)
{
char const* sourceCode =
" contract Base { \n"
" function baseFunction(uint p) returns (uint i) { return p; } \n"
- " event baseEvent(string32 indexed evtArgBase); \n"
+ " event baseEvent(bytes32 indexed evtArgBase); \n"
" } \n"
" contract Derived is Base { \n"
- " function derivedFunction(string32 p) returns (string32 i) { return p; } \n"
+ " function derivedFunction(bytes32 p) returns (bytes32 i) { return p; } \n"
" event derivedEvent(uint indexed evtArgDerived); \n"
" }";
@@ -369,17 +389,18 @@ BOOST_AUTO_TEST_CASE(inherited)
"inputs":
[{
"name": "p",
- "type": "string32"
+ "type": "bytes32"
}],
"outputs":
[{
"name": "i",
- "type": "string32"
+ "type": "bytes32"
}]
},
{
"name": "derivedEvent",
"type": "event",
+ "anonymous": false,
"inputs":
[{
"indexed": true,
@@ -390,11 +411,12 @@ BOOST_AUTO_TEST_CASE(inherited)
{
"name": "baseEvent",
"type": "event",
+ "anonymous": false,
"inputs":
[{
"indexed": true,
"name": "evtArgBase",
- "type": "string32"
+ "type": "bytes32"
}]
}])";
@@ -479,3 +501,5 @@ BOOST_AUTO_TEST_SUITE_END()
}
}
}
+
+#endif