From 44374a58466cd590ee1497ed5cf7f36c3f0f5548 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Tue, 8 May 2018 13:08:06 +0200 Subject: [PATCH] Remove "constant" from JSON AST. --- Changelog.md | 1 + libsolidity/ast/ASTJsonConverter.cpp | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Changelog.md b/Changelog.md index 89841cf08..086dbd9fa 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 a26828a6d..a8ede66a5 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -325,9 +325,6 @@ bool ASTJsonConverter::visit(FunctionDefinition const& _node) std::vector> 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))