aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityABIJSON.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-04-07 23:08:49 +0800
committerchriseth <c@ethdev.com>2015-04-07 23:08:49 +0800
commit367d0367eebd9961a2a234a7de2c29256652049d (patch)
treea49627c646666576184d0396c38fa5e06405c9b1 /SolidityABIJSON.cpp
parentf5b1fec699c246d3f395a69db6dcf7e282c42113 (diff)
parent1c13f1e4d54913da5eab604ac7434d747cb9dd0e (diff)
downloaddexon-solidity-367d0367eebd9961a2a234a7de2c29256652049d.tar
dexon-solidity-367d0367eebd9961a2a234a7de2c29256652049d.tar.gz
dexon-solidity-367d0367eebd9961a2a234a7de2c29256652049d.tar.bz2
dexon-solidity-367d0367eebd9961a2a234a7de2c29256652049d.tar.lz
dexon-solidity-367d0367eebd9961a2a234a7de2c29256652049d.tar.xz
dexon-solidity-367d0367eebd9961a2a234a7de2c29256652049d.tar.zst
dexon-solidity-367d0367eebd9961a2a234a7de2c29256652049d.zip
Merge remote-tracking branch 'ethereum/develop' into sol_overloadingFunctions
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