defi-wonderland / smock

The Solidity mocking library
MIT License
319 stars 40 forks source link

Cannot simulate functions with multiple returned values #88

Closed leodinh closed 2 years ago

leodinh commented 2 years ago

Describe the bug I tried to simulate a function with multiple returned values but got error

Reproduction steps This is the my function in the contract : function getData() public view returns (uint256 _index,uint256 _index1) { _index = uint256(1); _index1 = uint256(2); } This is the function I use to simulate: contract.getData.returns({_index: 2,_index1: 3}); The error I got: Uncaught RuntimeError: abort(Error: Failed to encode return value for getData). Build with -s ASSERTIONS=1 for more info.

0xGorilla commented 2 years ago

Hey @leodinh , did you manage to solve it?

Did you try doing contract.getData.returns([2, 3]);?