aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-08-24 21:08:31 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-16 19:31:12 +0800
commit6385641f6e461a1964da793956fbe0ef8cddadd3 (patch)
tree249b9de69b5c799bbe35032ff6820780ea790a58
parent44825d1c1ecef6ea3fa27da6330c12dcf4279fb3 (diff)
downloaddexon-solidity-6385641f6e461a1964da793956fbe0ef8cddadd3.tar.gz
dexon-solidity-6385641f6e461a1964da793956fbe0ef8cddadd3.tar.zst
dexon-solidity-6385641f6e461a1964da793956fbe0ef8cddadd3.zip
Fix tests.
-rw-r--r--libsolidity/ast/Types.h2
-rw-r--r--libsolidity/interface/ABI.h2
-rw-r--r--test/libsolidity/SolidityABIJSON.cpp4
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp1
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp8
5 files changed, 11 insertions, 6 deletions
diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h
index 0713f527..dd50c573 100644
--- a/libsolidity/ast/Types.h
+++ b/libsolidity/ast/Types.h
@@ -248,7 +248,7 @@ public:
/// @returns the canonical name of this type for use in library function signatures.
virtual std::string canonicalName() const { return toString(true); }
/// @returns the signature of this type in external functions, i.e. `uint256` for integers
- /// or `(uint256, bytes8)[2]` for an array of structs. If @a _structsByName,
+ /// or `(uint256,bytes8)[2]` for an array of structs. If @a _structsByName,
/// structs are given by canonical name like `ContractName.StructName[2]`.
virtual std::string signatureInExternalFunction(bool /*_structsByName*/) const
{
diff --git a/libsolidity/interface/ABI.h b/libsolidity/interface/ABI.h
index 7e42909b..db70729d 100644
--- a/libsolidity/interface/ABI.h
+++ b/libsolidity/interface/ABI.h
@@ -50,7 +50,7 @@ private:
std::vector<TypePointer> const& _types,
bool _forLibrary
);
- /// @returns a Json object with "name", "type" and potentially "subtype" keys, according
+ /// @returns a Json object with "name", "type" and potentially "components" keys, according
/// to the ABI specification.
/// If it is possible to express the type as a single string, it is allowed to return a single string.
static Json::Value formatType(std::string const& _name, Type const& _type, bool _forLibrary);
diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp
index 5ddd28ad..e4ab54ec 100644
--- a/test/libsolidity/SolidityABIJSON.cpp
+++ b/test/libsolidity/SolidityABIJSON.cpp
@@ -981,6 +981,7 @@ BOOST_AUTO_TEST_CASE(return_structs)
}
],
"payable" : false,
+ "stateMutability" : "nonpayable",
"type" : "function"
}]
)";
@@ -1022,6 +1023,7 @@ BOOST_AUTO_TEST_CASE(return_structs_with_contracts)
}
],
"payable": false,
+ "stateMutability" : "nonpayable",
"type": "function"
}]
)";
@@ -1127,6 +1129,7 @@ BOOST_AUTO_TEST_CASE(structs_in_libraries)
"name": "g",
"outputs": [],
"payable": false,
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -1140,6 +1143,7 @@ BOOST_AUTO_TEST_CASE(structs_in_libraries)
"name": "f",
"outputs": [],
"payable": false,
+ "stateMutability": "nonpayable",
"type": "function"
}]
)";
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 393d3c64..2bdcbd48 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -9685,6 +9685,7 @@ BOOST_AUTO_TEST_CASE(contracts_separated_with_comment)
BOOST_AUTO_TEST_CASE(return_structs)
{
char const* sourceCode = R"(
+ pragma experimental ABIEncoderV2;
contract C {
struct S { uint a; T[] sub; }
struct T { uint[2] x; }
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index dcab8fb0..778c12c5 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -1102,7 +1102,7 @@ BOOST_AUTO_TEST_CASE(struct_accessor_one_array_only)
Data public data;
}
)";
- CHECK_ERROR(sourceCode, TypeError, "Internal type is not allowed for public state variables.");
+ CHECK_ERROR(sourceCode, TypeError, "Internal or recursive type is not allowed for public state variables.");
}
BOOST_AUTO_TEST_CASE(base_class_state_variable_internal_member)
@@ -4904,7 +4904,7 @@ BOOST_AUTO_TEST_CASE(internal_function_as_external_parameter)
}
}
)";
- CHECK_ERROR(text, TypeError, "Internal type is not allowed for public or external functions.");
+ CHECK_ERROR(text, TypeError, "Internal or recursive type is not allowed for public or external functions.");
}
BOOST_AUTO_TEST_CASE(internal_function_returned_from_public_function)
@@ -4916,7 +4916,7 @@ BOOST_AUTO_TEST_CASE(internal_function_returned_from_public_function)
}
}
)";
- CHECK_ERROR(text, TypeError, "Internal type is not allowed for public or external functions.");
+ CHECK_ERROR(text, TypeError, "Internal or recursive type is not allowed for public or external functions.");
}
BOOST_AUTO_TEST_CASE(internal_function_as_external_parameter_in_library_internal)
@@ -4938,7 +4938,7 @@ BOOST_AUTO_TEST_CASE(internal_function_as_external_parameter_in_library_external
}
}
)";
- CHECK_ERROR(text, TypeError, "Internal type is not allowed for public or external functions.");
+ CHECK_ERROR(text, TypeError, "Internal or recursive type is not allowed for public or external functions.");
}
BOOST_AUTO_TEST_CASE(function_type_arrays)