-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BREAKING] Drop constant and payable from ABI. #4090
Conversation
One of the reasons to create this was to see how the tests behave and start a discussion about that. |
@ekpyron can we merge the |
@axic That's true - I have them in separate commits here, so I'll extract them into a separate PR shortly! |
Once #4093 is merged to develop and develop is merged into 050, I'll rebase this PR. |
The ViewPureChecker must be updated to be turned on for |
Of course, since this last change ( |
5ff0e91
to
ebd020d
Compare
Rebased and removed the commit that updates |
f4f8f1f
to
2d43635
Compare
for (ContractDefinition const* c: source->filteredNodes<ContractDefinition>(source->nodes())) | ||
contracts[c] = enforceView; | ||
auto const& sourceContracts = source->filteredNodes<ContractDefinition>(source->nodes()); | ||
contracts.insert(contracts.end(), sourceContracts.begin(), sourceContracts.end()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use contracts = source->filteredNodes<ContractDefinition>(source->nodes())
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know that that is defined for std::vector in libdevcore - I'll change it.
test/contracts/LLL_ERC20.cpp
Outdated
@@ -216,39 216,39 @@ static char const* erc20Code = R"DELIMITER( | |||
|
|||
;; ---------------------------------------------------------------------- | |||
;; Getter for the name of the token. | |||
;; @abi name() constant returns (string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is lll, do we really want to change it?
test/libsolidity/ASTLegacyJSON.cpp
Outdated
@@ -266,15 266,13 @@ BOOST_AUTO_TEST_CASE(function_type) | |||
BOOST_CHECK_EQUAL(argument["attributes"]["name"], "x"); | |||
BOOST_CHECK_EQUAL(argument["attributes"]["type"], "function () payable external returns (uint256)"); | |||
Json::Value funType = argument["children"][0]; | |||
BOOST_CHECK_EQUAL(funType["attributes"]["constant"], false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the corresponding check about stateMutability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
58e64a3
to
7c0f44f
Compare
7c0f44f
to
09e0816
Compare
fb6f033
to
fb73042
Compare
@ekpyron can you create a PR with the AST changes only? |
@axic I will. |
docs/abi-spec.rst
Outdated
- ``constant``: ``true`` if function is either ``pure`` or ``view``, ``false`` otherwise. | ||
|
||
``type`` can be omitted, defaulting to ``"function"``, likewise ``payable`` and ``constant`` can be omitted, both defaulting to ``false``. | ||
.. warning:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the warning
below, which has the same content.
fb73042
to
5ebfcd4
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4090 /- ##
==========================================
Coverage ? 28.31%
==========================================
Files ? 313
Lines ? 30650
Branches ? 3662
==========================================
Hits ? 8678
Misses ? 21301
Partials ? 671
|
@axic we do and it's a breaking change for us, we'll need to update |
5ebfcd4
to
6805900
Compare
@axic Yes, I think we were pretty much heading towards postponing this anyways and classifying this as |
Removed from 0.5.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be rebased.
6805900
to
4415541
Compare
Rebased. The question is whether we consider this a "breaking change" for 0.6.0 or an "ecosystem/interface change" the we can do before that.
It is missing a changelog entry and all the tests are failing. |
4415541
to
9a6adf8
Compare
9a6adf8
to
6e5de3b
Compare
6e5de3b
to
361d1b9
Compare
Easy to recreate and unclear when we'll actually do this, so I'm closing this PR for now and added the issue to the backlog. |
Closes #4755.
Part of #3656.
To be discussed:
test/compilationTests/
?050
branch at this point?