defi-wonderland / smock

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

BUG Functions that returns an array, always returns unexpected amount of data #121

Closed stefanandy closed 2 years ago

stefanandy commented 2 years ago

Describe the bug When trying to mock the return of an functions that returns and array of addresses, no matter what output you give in the returns function, you will always get the error, "Error: Transaction reverted: function returned an unexpected amount of data"

Reproduction steps

  1. Create a sc that have a function that will return an array of addresses.
  2. Create a fake for the sc.
  3. Mock the function output.
  4. Call the function from a sc that is calling the fake.
  5. Get the error

Expected behavior Returned the mocked values

Screenshots

image image

System Specs:

wei3erHase commented 2 years ago

arrays are currently not supported, this is related to #31 closing this issue so that we have only 1 task for this, thanks for the time taken describing the bug :)