Skip to content

Prepare drop constant keyword.#4093

Merged
chriseth merged 4 commits intodevelopfrom
prepareDropConstantKeyword
May 14, 2018
Merged

Prepare drop constant keyword.#4093
chriseth merged 4 commits intodevelopfrom
prepareDropConstantKeyword

Conversation

@ekpyron
Copy link
Copy Markdown
Collaborator

@ekpyron ekpyron commented May 8, 2018

Part of #2502.

Adjust tests, documentation, style guide, std contracts in preparation of #4090.

This is the non-breaking subset of #4090.

@ekpyron ekpyron self-assigned this May 8, 2018
docs/grammar.txt Outdated
( 'returns' FunctionTypeParameterList )?
StorageLocation = 'memory' | 'storage'
StateMutability = 'pure' | 'constant' | 'view' | 'payable'
StateMutability = 'pure' | 'view' | 'payable'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot be removed here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - the idea of this (and the one's below) was to already update the documentation as if constant had already been removed and only mentioning it's existence in a note, but you're probably right that it's better to postpone that until the breaking change.

- ``view`` for functions: Disallows modification of state - this is not enforced yet.
- ``payable`` for functions: Allows them to receive Ether together with a call.
- ``constant`` for state variables: Disallows assignment (except initialisation), does not occupy storage slot.
- ``constant`` for functions: Same as ``view``.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot be removed here.

docs/types.rst Outdated
Function types are notated as follows::

function (<parameter types>) {internal|external} [pure|constant|view|payable] [returns (<return types>)]
function (<parameter types>) {internal|external} [pure|view|payable] [returns (<return types>)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot be removed here.

axic
axic previously requested changes May 8, 2018
Copy link
Copy Markdown
Contributor

@axic axic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a syntax test which deals with constant (will be removed as part of #4090)

@ekpyron ekpyron force-pushed the prepareDropConstantKeyword branch from bb56248 to 9055b9c Compare May 8, 2018 16:37
@axic axic force-pushed the prepareDropConstantKeyword branch 3 times, most recently from 0ad10dc to a6a8b0f Compare May 9, 2018 13:00
axic
axic previously approved these changes May 9, 2018
@axic axic force-pushed the prepareDropConstantKeyword branch from a6a8b0f to bc47265 Compare May 9, 2018 13:07
@axic
Copy link
Copy Markdown
Contributor

axic commented May 9, 2018

Rebased after #4104.

axic
axic previously approved these changes May 9, 2018
@axic
Copy link
Copy Markdown
Contributor

axic commented May 9, 2018

@chriseth OK with this? (mostly the documentation changes)

@ekpyron
Copy link
Copy Markdown
Collaborator Author

ekpyron commented May 11, 2018

@axic I added another commit that removes view from end-to-end-tests in cases where it will fail once the ViewPureChecker enforces view in 0.5.0.

@ekpyron ekpyron force-pushed the prepareDropConstantKeyword branch from e313466 to 9b7ded2 Compare May 11, 2018 09:11
@ekpyron ekpyron requested review from axic and chriseth May 11, 2018 09:13
@chriseth chriseth merged commit ab63ab1 into develop May 14, 2018
@axic axic deleted the prepareDropConstantKeyword branch May 15, 2018 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants