aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changelog.md1
-rw-r--r--libsolidity/ast/ASTJsonConverter.cpp6
-rw-r--r--test/libsolidity/ASTJSON/documentation.json2
-rw-r--r--test/libsolidity/ASTJSON/documentation_legacy.json2
-rw-r--r--test/libsolidity/ASTJSON/function_type.json6
-rw-r--r--test/libsolidity/ASTJSON/function_type_legacy.json6
-rw-r--r--test/libsolidity/ASTJSON/long_type_name_binary_operation.json2
-rw-r--r--test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json2
-rw-r--r--test/libsolidity/ASTJSON/long_type_name_identifier.json2
-rw-r--r--test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json2
-rw-r--r--test/libsolidity/ASTJSON/modifier_definition.json2
-rw-r--r--test/libsolidity/ASTJSON/modifier_definition_legacy.json2
-rw-r--r--test/libsolidity/ASTJSON/modifier_invocation.json2
-rw-r--r--test/libsolidity/ASTJSON/modifier_invocation_legacy.json2
-rw-r--r--test/libsolidity/ASTJSON/non_utf8.json2
-rw-r--r--test/libsolidity/ASTJSON/non_utf8_legacy.json2
-rw-r--r--test/libsolidity/ASTJSON/short_type_name.json2
-rw-r--r--test/libsolidity/ASTJSON/short_type_name_legacy.json2
-rw-r--r--test/libsolidity/ASTJSON/short_type_name_ref.json2
-rw-r--r--test/libsolidity/ASTJSON/short_type_name_ref_legacy.json2
-rw-r--r--test/libsolidity/ASTJSON/source_location.json2
-rw-r--r--test/libsolidity/ASTJSON/source_location_legacy.json2
22 files changed, 1 insertions, 54 deletions
diff --git a/Changelog.md b/Changelog.md
index 1cc2ee4a..aa2dce18 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -33,6 +33,7 @@ Breaking Changes:
* General: Remove assembly instruction aliases ``sha3`` and ``suicide``
* General: C99-style scoping rules are enforced now. This was already the case in the experimental 0.5.0 mode.
* General: Disallow combining hex numbers with unit denominations (e.g. ``0x1e wei``). This was already the case in the experimental 0.5.0 mode.
+ * JSON AST: Remove ``constant`` and ``payable`` fields (the information is encoded in the ``stateMutability`` field).
* Name Resolver: Do not exclude public state variables when looking for conflicting declarations.
* Optimizer: Remove the no-op ``PUSH1 0 NOT AND`` sequence.
* Parser: Disallow trailing dots that are not followed by a number.
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp
index a26828a6..a8ede66a 100644
--- a/libsolidity/ast/ASTJsonConverter.cpp
+++ b/libsolidity/ast/ASTJsonConverter.cpp
@@ -325,9 +325,6 @@ bool ASTJsonConverter::visit(FunctionDefinition const& _node)
std::vector<pair<string, Json::Value>> attributes = {
make_pair("name", _node.name()),
make_pair("documentation", _node.documentation() ? Json::Value(*_node.documentation()) : Json::nullValue),
- // FIXME: remove with next breaking release
- make_pair(m_legacy ? "constant" : "isDeclaredConst", _node.stateMutability() <= StateMutability::View),
- make_pair("payable", _node.isPayable()),
make_pair("stateMutability", stateMutabilityToString(_node.stateMutability())),
make_pair("superFunction", idOrNull(_node.annotation().superFunction)),
make_pair("visibility", Declaration::visibilityToString(_node.visibility())),
@@ -418,11 +415,8 @@ bool ASTJsonConverter::visit(UserDefinedTypeName const& _node)
bool ASTJsonConverter::visit(FunctionTypeName const& _node)
{
setJsonNode(_node, "FunctionTypeName", {
- make_pair("payable", _node.isPayable()),
make_pair("visibility", Declaration::visibilityToString(_node.visibility())),
make_pair("stateMutability", stateMutabilityToString(_node.stateMutability())),
- // FIXME: remove with next breaking release
- make_pair(m_legacy ? "constant" : "isDeclaredConst", _node.stateMutability() <= StateMutability::View),
make_pair("parameterTypes", toJson(*_node.parameterTypeList())),
make_pair("returnParameterTypes", toJson(*_node.returnParameterTypeList())),
make_pair("typeDescriptions", typePointerToJson(_node.annotation().type, true))
diff --git a/test/libsolidity/ASTJSON/documentation.json b/test/libsolidity/ASTJSON/documentation.json
index 56b748c1..403d4e72 100644
--- a/test/libsolidity/ASTJSON/documentation.json
+++ b/test/libsolidity/ASTJSON/documentation.json
@@ -148,7 +148,6 @@
"id" : 14,
"implemented" : true,
"isConstructor" : false,
- "isDeclaredConst" : false,
"modifiers" : [],
"name" : "fn",
"nodeType" : "FunctionDefinition",
@@ -159,7 +158,6 @@
"parameters" : [],
"src" : "145:2:3"
},
- "payable" : false,
"returnParameters" :
{
"id" : 12,
diff --git a/test/libsolidity/ASTJSON/documentation_legacy.json b/test/libsolidity/ASTJSON/documentation_legacy.json
index 44ae537b..5a890e50 100644
--- a/test/libsolidity/ASTJSON/documentation_legacy.json
+++ b/test/libsolidity/ASTJSON/documentation_legacy.json
@@ -105,7 +105,6 @@
{
"attributes" :
{
- "constant" : false,
"documentation" : "Some comment on fn.",
"implemented" : true,
"isConstructor" : false,
@@ -114,7 +113,6 @@
null
],
"name" : "fn",
- "payable" : false,
"scope" : 15,
"stateMutability" : "nonpayable",
"superFunction" : null,
diff --git a/test/libsolidity/ASTJSON/function_type.json b/test/libsolidity/ASTJSON/function_type.json
index f0389d17..7b10f0dc 100644
--- a/test/libsolidity/ASTJSON/function_type.json
+++ b/test/libsolidity/ASTJSON/function_type.json
@@ -38,7 +38,6 @@
"id" : 16,
"implemented" : true,
"isConstructor" : false,
- "isDeclaredConst" : false,
"modifiers" : [],
"name" : "f",
"nodeType" : "FunctionDefinition",
@@ -65,7 +64,6 @@
"typeName" :
{
"id" : 5,
- "isDeclaredConst" : false,
"nodeType" : "FunctionTypeName",
"parameterTypes" :
{
@@ -74,7 +72,6 @@
"parameters" : [],
"src" : "32:2:1"
},
- "payable" : true,
"returnParameterTypes" :
{
"id" : 4,
@@ -128,7 +125,6 @@
],
"src" : "23:46:1"
},
- "payable" : false,
"returnParameters" :
{
"id" : 14,
@@ -152,7 +148,6 @@
"typeName" :
{
"id" : 12,
- "isDeclaredConst" : true,
"nodeType" : "FunctionTypeName",
"parameterTypes" :
{
@@ -161,7 +156,6 @@
"parameters" : [],
"src" : "87:2:1"
},
- "payable" : false,
"returnParameterTypes" :
{
"id" : 11,
diff --git a/test/libsolidity/ASTJSON/function_type_legacy.json b/test/libsolidity/ASTJSON/function_type_legacy.json
index 4db5fb1c..952fd865 100644
--- a/test/libsolidity/ASTJSON/function_type_legacy.json
+++ b/test/libsolidity/ASTJSON/function_type_legacy.json
@@ -38,7 +38,6 @@
{
"attributes" :
{
- "constant" : false,
"documentation" : null,
"implemented" : true,
"isConstructor" : false,
@@ -47,7 +46,6 @@
null
],
"name" : "f",
- "payable" : false,
"scope" : 17,
"stateMutability" : "nonpayable",
"superFunction" : null,
@@ -75,8 +73,6 @@
{
"attributes" :
{
- "constant" : false,
- "payable" : true,
"stateMutability" : "payable",
"type" : "function () payable external returns (uint256)",
"visibility" : "external"
@@ -168,8 +164,6 @@
{
"attributes" :
{
- "constant" : true,
- "payable" : false,
"stateMutability" : "view",
"type" : "function () view external returns (uint256)",
"visibility" : "external"
diff --git a/test/libsolidity/ASTJSON/long_type_name_binary_operation.json b/test/libsolidity/ASTJSON/long_type_name_binary_operation.json
index 6a956ca4..fe3e73d2 100644
--- a/test/libsolidity/ASTJSON/long_type_name_binary_operation.json
+++ b/test/libsolidity/ASTJSON/long_type_name_binary_operation.json
@@ -143,7 +143,6 @@
"id" : 10,
"implemented" : true,
"isConstructor" : false,
- "isDeclaredConst" : false,
"modifiers" : [],
"name" : "f",
"nodeType" : "FunctionDefinition",
@@ -154,7 +153,6 @@
"parameters" : [],
"src" : "23:2:1"
},
- "payable" : false,
"returnParameters" :
{
"id" : 2,
diff --git a/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json b/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json
index cd4eefb1..d78d01ff 100644
--- a/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json
+++ b/test/libsolidity/ASTJSON/long_type_name_binary_operation_legacy.json
@@ -38,7 +38,6 @@
{
"attributes" :
{
- "constant" : false,
"documentation" : null,
"implemented" : true,
"isConstructor" : false,
@@ -47,7 +46,6 @@
null
],
"name" : "f",
- "payable" : false,
"scope" : 11,
"stateMutability" : "nonpayable",
"superFunction" : null,
diff --git a/test/libsolidity/ASTJSON/long_type_name_identifier.json b/test/libsolidity/ASTJSON/long_type_name_identifier.json
index b1f8faa2..0579967c 100644
--- a/test/libsolidity/ASTJSON/long_type_name_identifier.json
+++ b/test/libsolidity/ASTJSON/long_type_name_identifier.json
@@ -149,7 +149,6 @@
"id" : 13,
"implemented" : true,
"isConstructor" : false,
- "isDeclaredConst" : false,
"modifiers" : [],
"name" : "f",
"nodeType" : "FunctionDefinition",
@@ -160,7 +159,6 @@
"parameters" : [],
"src" : "33:2:1"
},
- "payable" : false,
"returnParameters" :
{
"id" : 5,
diff --git a/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json b/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json
index d7739f10..a96ccef3 100644
--- a/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json
+++ b/test/libsolidity/ASTJSON/long_type_name_identifier_legacy.json
@@ -80,7 +80,6 @@
{
"attributes" :
{
- "constant" : false,
"documentation" : null,
"implemented" : true,
"isConstructor" : false,
@@ -89,7 +88,6 @@
null
],
"name" : "f",
- "payable" : false,
"scope" : 14,
"stateMutability" : "nonpayable",
"superFunction" : null,
diff --git a/test/libsolidity/ASTJSON/modifier_definition.json b/test/libsolidity/ASTJSON/modifier_definition.json
index da64b78d..95554f03 100644
--- a/test/libsolidity/ASTJSON/modifier_definition.json
+++ b/test/libsolidity/ASTJSON/modifier_definition.json
@@ -98,7 +98,6 @@
"id" : 13,
"implemented" : true,
"isConstructor" : false,
- "isDeclaredConst" : false,
"modifiers" :
[
{
@@ -153,7 +152,6 @@
"parameters" : [],
"src" : "49:2:1"
},
- "payable" : false,
"returnParameters" :
{
"id" : 11,
diff --git a/test/libsolidity/ASTJSON/modifier_definition_legacy.json b/test/libsolidity/ASTJSON/modifier_definition_legacy.json
index f38d07be..e1e797ba 100644
--- a/test/libsolidity/ASTJSON/modifier_definition_legacy.json
+++ b/test/libsolidity/ASTJSON/modifier_definition_legacy.json
@@ -102,12 +102,10 @@
{
"attributes" :
{
- "constant" : false,
"documentation" : null,
"implemented" : true,
"isConstructor" : false,
"name" : "F",
- "payable" : false,
"scope" : 14,
"stateMutability" : "nonpayable",
"superFunction" : null,
diff --git a/test/libsolidity/ASTJSON/modifier_invocation.json b/test/libsolidity/ASTJSON/modifier_invocation.json
index da64b78d..95554f03 100644
--- a/test/libsolidity/ASTJSON/modifier_invocation.json
+++ b/test/libsolidity/ASTJSON/modifier_invocation.json
@@ -98,7 +98,6 @@
"id" : 13,
"implemented" : true,
"isConstructor" : false,
- "isDeclaredConst" : false,
"modifiers" :
[
{
@@ -153,7 +152,6 @@
"parameters" : [],
"src" : "49:2:1"
},
- "payable" : false,
"returnParameters" :
{
"id" : 11,
diff --git a/test/libsolidity/ASTJSON/modifier_invocation_legacy.json b/test/libsolidity/ASTJSON/modifier_invocation_legacy.json
index f38d07be..e1e797ba 100644
--- a/test/libsolidity/ASTJSON/modifier_invocation_legacy.json
+++ b/test/libsolidity/ASTJSON/modifier_invocation_legacy.json
@@ -102,12 +102,10 @@
{
"attributes" :
{
- "constant" : false,
"documentation" : null,
"implemented" : true,
"isConstructor" : false,
"name" : "F",
- "payable" : false,
"scope" : 14,
"stateMutability" : "nonpayable",
"superFunction" : null,
diff --git a/test/libsolidity/ASTJSON/non_utf8.json b/test/libsolidity/ASTJSON/non_utf8.json
index ec4804f1..307259e9 100644
--- a/test/libsolidity/ASTJSON/non_utf8.json
+++ b/test/libsolidity/ASTJSON/non_utf8.json
@@ -90,7 +90,6 @@
"id" : 7,
"implemented" : true,
"isConstructor" : false,
- "isDeclaredConst" : false,
"modifiers" : [],
"name" : "f",
"nodeType" : "FunctionDefinition",
@@ -101,7 +100,6 @@
"parameters" : [],
"src" : "23:2:1"
},
- "payable" : false,
"returnParameters" :
{
"id" : 2,
diff --git a/test/libsolidity/ASTJSON/non_utf8_legacy.json b/test/libsolidity/ASTJSON/non_utf8_legacy.json
index d83d2d97..b1f847f7 100644
--- a/test/libsolidity/ASTJSON/non_utf8_legacy.json
+++ b/test/libsolidity/ASTJSON/non_utf8_legacy.json
@@ -38,7 +38,6 @@
{
"attributes" :
{
- "constant" : false,
"documentation" : null,
"implemented" : true,
"isConstructor" : false,
@@ -47,7 +46,6 @@
null
],
"name" : "f",
- "payable" : false,
"scope" : 8,
"stateMutability" : "nonpayable",
"superFunction" : null,
diff --git a/test/libsolidity/ASTJSON/short_type_name.json b/test/libsolidity/ASTJSON/short_type_name.json
index 32df8cde..502c1e31 100644
--- a/test/libsolidity/ASTJSON/short_type_name.json
+++ b/test/libsolidity/ASTJSON/short_type_name.json
@@ -94,7 +94,6 @@
"id" : 9,
"implemented" : true,
"isConstructor" : false,
- "isDeclaredConst" : false,
"modifiers" : [],
"name" : "f",
"nodeType" : "FunctionDefinition",
@@ -105,7 +104,6 @@
"parameters" : [],
"src" : "23:2:1"
},
- "payable" : false,
"returnParameters" :
{
"id" : 2,
diff --git a/test/libsolidity/ASTJSON/short_type_name_legacy.json b/test/libsolidity/ASTJSON/short_type_name_legacy.json
index d14954c8..761bcd3b 100644
--- a/test/libsolidity/ASTJSON/short_type_name_legacy.json
+++ b/test/libsolidity/ASTJSON/short_type_name_legacy.json
@@ -38,7 +38,6 @@
{
"attributes" :
{
- "constant" : false,
"documentation" : null,
"implemented" : true,
"isConstructor" : false,
@@ -47,7 +46,6 @@
null
],
"name" : "f",
- "payable" : false,
"scope" : 10,
"stateMutability" : "nonpayable",
"superFunction" : null,
diff --git a/test/libsolidity/ASTJSON/short_type_name_ref.json b/test/libsolidity/ASTJSON/short_type_name_ref.json
index ebe940cf..b0c3ad97 100644
--- a/test/libsolidity/ASTJSON/short_type_name_ref.json
+++ b/test/libsolidity/ASTJSON/short_type_name_ref.json
@@ -106,7 +106,6 @@
"id" : 10,
"implemented" : true,
"isConstructor" : false,
- "isDeclaredConst" : false,
"modifiers" : [],
"name" : "f",
"nodeType" : "FunctionDefinition",
@@ -117,7 +116,6 @@
"parameters" : [],
"src" : "23:2:1"
},
- "payable" : false,
"returnParameters" :
{
"id" : 2,
diff --git a/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json b/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json
index aaf9b8be..d426a384 100644
--- a/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json
+++ b/test/libsolidity/ASTJSON/short_type_name_ref_legacy.json
@@ -38,7 +38,6 @@
{
"attributes" :
{
- "constant" : false,
"documentation" : null,
"implemented" : true,
"isConstructor" : false,
@@ -47,7 +46,6 @@
null
],
"name" : "f",
- "payable" : false,
"scope" : 11,
"stateMutability" : "nonpayable",
"superFunction" : null,
diff --git a/test/libsolidity/ASTJSON/source_location.json b/test/libsolidity/ASTJSON/source_location.json
index bd9290fd..8d8acb0f 100644
--- a/test/libsolidity/ASTJSON/source_location.json
+++ b/test/libsolidity/ASTJSON/source_location.json
@@ -128,7 +128,6 @@
"id" : 10,
"implemented" : true,
"isConstructor" : false,
- "isDeclaredConst" : false,
"modifiers" : [],
"name" : "f",
"nodeType" : "FunctionDefinition",
@@ -139,7 +138,6 @@
"parameters" : [],
"src" : "23:2:1"
},
- "payable" : false,
"returnParameters" :
{
"id" : 2,
diff --git a/test/libsolidity/ASTJSON/source_location_legacy.json b/test/libsolidity/ASTJSON/source_location_legacy.json
index d046e6ae..327cd6da 100644
--- a/test/libsolidity/ASTJSON/source_location_legacy.json
+++ b/test/libsolidity/ASTJSON/source_location_legacy.json
@@ -38,7 +38,6 @@
{
"attributes" :
{
- "constant" : false,
"documentation" : null,
"implemented" : true,
"isConstructor" : false,
@@ -47,7 +46,6 @@
null
],
"name" : "f",
- "payable" : false,
"scope" : 11,
"stateMutability" : "nonpayable",
"superFunction" : null,