Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update ERC827.sol to not use function overloading #871

Merged
merged 7 commits into from
Apr 23, 2018

Conversation

elie222
Copy link
Contributor

@elie222 elie222 commented Apr 5, 2018

🚀 Description

Renaming of ERC827 function names to avoid using function overloading. This also needs to be accepted by Ethereum team.

This causes problems with projects such as Vyper:
vyperlang/vyper#738

  • 📘 I've reviewed the OpenZeppelin Contributor Guidelines
  • ✅ I've added tests where applicable to test my new functionality.
  • 📖 I've made sure that my contracts are well-documented.
  • 🎨 I've run the JS/Solidity linters and fixed any issues (npm run lint:all:fix).

@AugustoL
Copy link
Contributor

AugustoL commented Apr 5, 2018

@elie222 can you make the changes in the tests to run with the new method names?

@elie222
Copy link
Contributor Author

elie222 commented Apr 5, 2018 via email

@elie222
Copy link
Contributor Author

elie222 commented Apr 5, 2018

I updated the tests and they're all passing now.

@AugustoL
Copy link
Contributor

AugustoL commented Apr 5, 2018

@elie222
Copy link
Contributor Author

elie222 commented Apr 5, 2018

Yup. Sorry. Missed running some tests locally. Should work on Travis now

@AugustoL
Copy link
Contributor

AugustoL commented Apr 5, 2018

@elie222 great, with the new functions names the findMethod function in ERC827Token tests wont be needed, can you remove it too, it will make tests more readable?

@elie222
Copy link
Contributor Author

elie222 commented Apr 5, 2018 via email

@k06a
Copy link
Contributor

k06a commented Apr 5, 2018

Maybe to keep both method names?

@elie222
Copy link
Contributor Author

elie222 commented Apr 5, 2018 via email

@AugustoL
Copy link
Contributor

AugustoL commented Apr 5, 2018

is early enough, we dont want want duplicated code, I think we should keep the new names that avoid overloading.

@k06a
Copy link
Contributor

k06a commented Apr 5, 2018

@AugustoL no need to duplicate code, approve(address,uint256,bytes) can just call approveAndCall(address,uint256,bytes)

@elie222
Copy link
Contributor Author

elie222 commented Apr 5, 2018

Removed findMethod. Tests and linter passing

AugustoL
AugustoL previously approved these changes Apr 13, 2018
spalladino
spalladino previously approved these changes Apr 13, 2018
Copy link
Contributor

@spalladino spalladino left a comment

Choose a reason for hiding this comment

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

The changes LGTM. @AugustoL I'd say we merge this as soon as this is updated in the EIP, what do you think? Or would you rather merge this right away?

FWIW, I'm not a fan of avoiding function overloading just because it's part of the philosophy of one of the high-level languages available for the EVM. But if the ERC is changing, I think it's fair to change it here as well.

@AugustoL
Copy link
Contributor

@elie222 can you fix the conflicts in ERC827.sol so I can merge it?

@elie222 elie222 dismissed stale reviews from spalladino and AugustoL via ff47da6 April 22, 2018 15:21
@elie222
Copy link
Contributor Author

elie222 commented Apr 22, 2018

Done

@AugustoL AugustoL merged commit 16535fb into OpenZeppelin:master Apr 23, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants