Truffle does not support function overloading
See original GitHub issue- I’ve asked for help in the Truffle Gitter before filing this issue.
Issue
Truffle fails with a Error: Invalid number of arguments to Solidity function
error when testing an overloaded function.
Steps to Reproduce
- Checkout this branch
- Enable transfer and call test cases
- Run
npm test
Expected Behavior
Tests should pass. You can see that those tests work fine by changing the name of the overloaded function and using that name in the mentioned test cases.
Actual Results
Tests fail with a Error: Invalid number of arguments to Solidity function
error
Environment
- Operating System: Mac OS Sierra
- Truffle version: 4.0.1
- Ethereum client: testrpc
- node version: 8.4.0
- npm version: 5.5.1
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:24 (10 by maintainers)
Top Results From Across the Web
how to test overloaded function in truffle?
I recently upgraded truffle to the newest version. Now it does not automatically detect overloaded functions anymore.
Read more >Unit Test Overloaded Solidity Functions in Truffle - LinkedIn
When writing solidity the major reason is the fact that at the moment solidity does not support default values when working with functions....
Read more >Truffle does not support function overloading - - Bountysource
[ ] I've asked for help in the Truffle Gitter before filing this issue. Issue. Truffle fails with a Error: Invalid number of...
Read more >ConsenSys/truffle - Gitter
hey.... is it possible that truffle does not support function overloading? ... trufflesuite/truffle#737 is closed but for me it's not resolved.
Read more >Solidity Testing w/ Overloaded Functions | by Matt Swezey
But, but … but doesn't Solidity support function overloading? Yes ✓. Truffle's next release (v5) is out in beta now and supports testing...
Read more >
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m getting the same issue +1
@hynese This should be fixed on truffle’s nightly for the next major version (darq-truffle on npm) which you can get by running:
It uses web3 1.0 under the hood so there are some breaking changes. Usage notes here.
(If you try this feel free to ping with any problems, would love some early feedback on whether things are working in a production context).