Introduce view state-mutability (keep constant as alias)#2762
Merged
Conversation
13 tasks
2dcabe5 to
8b2cc41
Compare
axic
commented
Aug 21, 2017
libsolidity/interface/ABI.cpp
Outdated
| method["name"] = it.second->declaration().name(); | ||
| method["constant"] = it.second->isConstant(); | ||
| // FIXME: constant should be removed at the next breaking release | ||
| method["constant"] = it.second->isView(); |
Contributor
Author
There was a problem hiding this comment.
Basically it is only used here and in one test. Probably worth replacing with a direct check to statemutability.
Contributor
Author
|
Need to add tests for view. |
8b2cc41 to
473d3b4
Compare
078286d to
bb0ad04
Compare
Contributor
Author
|
@chriseth this should be ready now |
bb0ad04 to
5daf7ff
Compare
axic
commented
Aug 22, 2017
| auto returnParams = function->returnParameterTypes(); | ||
| BOOST_CHECK_EQUAL(returnParams.at(0)->canonicalName(false), "uint256"); | ||
| BOOST_CHECK(function->isConstant()); | ||
| BOOST_CHECK(function->stateMutability() == StateMutability::View); |
Contributor
Author
There was a problem hiding this comment.
These here require View (and cannot be substituted by Pure) because they ensure getters are view.
5daf7ff to
1d093c6
Compare
chriseth
reviewed
Aug 22, 2017
docs/contracts.rst
Outdated
| ************** | ||
|
|
||
| Functions can be declared constant in which case they promise not to modify the state. | ||
| Functions can be declared view in which case they promise not to modify the state. |
chriseth
approved these changes
Aug 22, 2017
1d093c6 to
b1cdf81
Compare
pemulis
added a commit
to pemulis/cryptokittybox
that referenced
this pull request
Mar 10, 2018
…llowing current conventions: argotorg/solidity#2762
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #992.