-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[isoltest] Add balance:
statement
#10426
Comments
Should be similar to |
That was the inspiration, but the second syntax proposal is better if we want to support querying any account (which I think would be useful to test transfers, etc.) |
the problem is that addresses are not fixed. If we want to query an external balance we could provide the contract name, but I think just supporting the balance of the "current" contract is already nice |
I think they are, but agree if there is no such big need yet to check other balances, that can done via wrapper functions and we can change this as the need arises. |
The syntax implemented by #10873 is:
The wei/ether suffix is not supported. |
Currently there is no simple way to query a contract balance in the semantic tests. Due to this lack of support, numerous tests were not moved from
SolidityEndToEndTest
.(It is possible to add a helper in the contract, like
function balance() external view returns (uint) { return address(this).balance; }
, but that is a bit overkill.)It would be nice to support a
// balance: 12 wei
or// balance -> 12 wei
line to assert balance at that given point.Could also consider checking the balance of any account, so perhaps the better syntax is:
The text was updated successfully, but these errors were encountered: