Skip to content
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

Return multiple values #2453

Closed
webersson opened this issue Mar 5, 2019 · 1 comment · Fixed by #2456
Closed

Return multiple values #2453

webersson opened this issue Mar 5, 2019 · 1 comment · Fixed by #2456
Labels
Bug Addressing a bug

Comments

@webersson
Copy link

Description

I'm trying to return multiple values with a simple function:

 function testMulReturn() public view returns (address, uint) {
       return (msg.sender, 777);
 }

Calling:

ContractInstance.methods.testMulReturn().call().then(function(result) {
	console.log(result);
})

Returns { '0': '0', '1': 'x' }

Calling a function with just one return value e.g

 function testMulReturn() public view returns (address) {
       return (msg.sender);
 }

...is working as expected.
Returns: 0x1b42dC2F1A3A548A5e6D76c19cCd768aDCa37815

Why is this happening? Any help much appreciated.

Versions

  • web3.js: 1.0.0-beta.47
  • nodejs: 11.3.0
  • solidity: ^0.5.0
@webersson
Copy link
Author

Just found out the issue does not consist with web3@1.0.0-beta.44.

@nivida nivida added Needs Clarification Requires additional input In Progress Currently being worked on labels Mar 5, 2019
@nivida nivida added Bug Addressing a bug and removed Needs Clarification Requires additional input In Progress Currently being worked on labels Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants