aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-23 02:09:35 +0800
committerGitHub <noreply@github.com>2017-08-23 02:09:35 +0800
commit0ffc5db82b24b4897d5d09cebbaadba37fa63b45 (patch)
tree023cefa5a9f00b0e6a5bf84d02745ab8e6666121 /libsolidity/ast
parent210b4870a805620329793c8ba2177a3ff6e7b477 (diff)
parentb1cdf81506de39502db0fb4a4b55ba8155f853ab (diff)
downloaddexon-solidity-0ffc5db82b24b4897d5d09cebbaadba37fa63b45.tar.gz
dexon-solidity-0ffc5db82b24b4897d5d09cebbaadba37fa63b45.tar.zst
dexon-solidity-0ffc5db82b24b4897d5d09cebbaadba37fa63b45.zip
Merge pull request #2762 from ethereum/statemutability-view
Introduce view state-mutability (keep constant as alias)
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/ASTJsonConverter.cpp2
-rw-r--r--libsolidity/ast/Types.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp
index f7661357..cb74ea39 100644
--- a/libsolidity/ast/ASTJsonConverter.cpp
+++ b/libsolidity/ast/ASTJsonConverter.cpp
@@ -323,6 +323,7 @@ bool ASTJsonConverter::visit(FunctionDefinition const& _node)
{
std::vector<pair<string, Json::Value>> attributes = {
make_pair("name", _node.name()),
+ // 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())),
@@ -415,6 +416,7 @@ bool ASTJsonConverter::visit(FunctionTypeName const& _node)
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())),
diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h
index 56546a82..ce2d3bf8 100644
--- a/libsolidity/ast/Types.h
+++ b/libsolidity/ast/Types.h
@@ -993,7 +993,6 @@ public:
return *m_declaration;
}
bool hasDeclaration() const { return !!m_declaration; }
- bool isConstant() const { return m_stateMutability == StateMutability::View; }
/// @returns true if the the result of this function only depends on its arguments
/// and it does not modify the state.
/// Currently, this will only return true for internal functions like keccak and ecrecover.