Closed kennisnutz closed 2 years ago
I was having the same error for the test test_get_user_total_value_with_different_tokens
.
The problem was that I've coded the return false
from isAllowedToken
inside the for
loop, so it was returning False
after the first loop instead of looping trough all allowedTokens.
If somebody else is having this issue, check if your return
s are correct in the isAllowedToken
solidity function:
function tokenIsAllowed(address _token) public view returns (bool) {
for (
uint256 allowedTokensIndex = 0;
allowedTokensIndex < allowedTokens.length;
allowedTokensIndex++
) {
if (allowedTokens[allowedTokensIndex] == _token) {
return true;
}
// don't return false here
}
return false;
}
Closing for now, thanks both for adding your info!
Omg It was my ignorance