question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

  1. Checkout this branch
  2. Enable transfer and call test cases
  3. 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:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:24 (10 by maintainers)

github_iconTop GitHub Comments

31reactions
nachomazzaracommented, Jan 15, 2018

I’m getting the same issue +1

6reactions
cgeweckecommented, May 22, 2018

@hynese This should be fixed on truffle’s nightly for the next major version (darq-truffle on npm) which you can get by running:

npm install -g darq-truffle@next
darq-truffle migrate --network ropsten # Example command

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found