From 36a90289e65b06c54326a1c254baa5fa6029f766 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 13 Jun 2017 10:51:49 +0200 Subject: Fix interface type conversion internal to structs. --- test/libsolidity/SolidityABIJSON.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'test/libsolidity/SolidityABIJSON.cpp') diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp index 7f03285d..3de8b732 100644 --- a/test/libsolidity/SolidityABIJSON.cpp +++ b/test/libsolidity/SolidityABIJSON.cpp @@ -980,6 +980,42 @@ BOOST_AUTO_TEST_CASE(return_structs) checkInterface(text, interface); } +BOOST_AUTO_TEST_CASE(return_structs_with_contracts) +{ + char const* text = R"( + contract C { + struct S { C[] x; C y; } + function f() returns (S s, C c) { + } + } + )"; + char const* interface = R"( + [ + { + "constant" : false, + "payable": false, + "inputs": [], + "name": "f", + "outputs" : [{ + "name" : "s", + "type" : [{ + "name" : "x", + "type" : "address[]" + }, { + "name" : "y", + "type" : "address" + }] + }, { + "name" : "c", + "type" : "address" + }], + "type" : "function" + } + ] + )"; + checkInterface(text, interface); +} + BOOST_AUTO_TEST_CASE(event_structs) { char const* text = R"( -- cgit v1.2.3