You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Faked function of mocked contract not working when called by other function
Reproduction steps
Let suppose we have a contract C, which has two functions, F1 and F2, where F1 returns the value of the passed parameter, and F2 calls to F1 and returns the corresponding result:
contractC{
function F1(uint256 x) publicpurereturns (uint256r){
r = x;
}
function F2(uint256 x) publicpurereturns (uint256r){
r =F1(x);
}
}
Then we create a mocked instance cM of contract C, and we set F1 to return always 0:
Describe the bug
Faked function of mocked contract not working when called by other function
Reproduction steps
Let suppose we have a contract C, which has two functions, F1 and F2, where F1 returns the value of the passed parameter, and F2 calls to F1 and returns the corresponding result:
Then we create a mocked instance cM of contract C, and we set F1 to return always 0:
Then if we call function F2 with any x value, it should return 0:
But the test above fails and it is returned 10 instead of 0.
Note that the following works as expected:
Expected behavior
In the explained scenario above: the call to the function F2 with any value as a parameter, should return 0.
Screenshots
NA
System Specs:
Additional context
NA
The text was updated successfully, but these errors were encountered: