echidna
echidna copied to clipboard
Helpful error message when using wrong function signature for echidna property
pragma solidity ^0.6.12;
contract Test {
function echidna_a() public view {
}
function echidna_b() public view returns (bool) {
return false;
}
}
will output:
echidna_a: failed with no transactions made ⁉️
echidna_b: failed with no transactions made ⁉️
echidna_b fails because it returns false.
echidna_a fails because it doesn't return a bool.
It would be nice to check the signature of echidna_ properties and display a helpful error message for echidna_a that distinguishes its failure from echidna_b.
This will reduce confusion for beginners.
On a similar note internal and private echidna_ properties obviously get ignored.
It would be nice to get a warning instead of ignoring user mistakes like that.
echidna_b fails because it returns false.
We have a #564 to show more information on why every tested failed.
echidna_a fails because it doesn't return a bool.
This is another issue. Echidna should not allow functions that do not declare any return value as properties.
We have a #564 to show more information on why every tested failed.
When writing echidna_b fails because it returns false it wasn't my intent to criticize the error reporting for echidna_b.
This is another issue. Echidna should not allow functions that do not declare any return value as properties.
That's what I mean with this issue.
Currently it's allowed and a beginner might accidentally write such a property.
Better to fail with a helpful error message when a user declares properties that don't return bool.