Skip to content

Fix tests for Foundry Stable #962

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

Merged
merged 6 commits into from
Apr 1, 2025
Merged

Fix tests for Foundry Stable #962

merged 6 commits into from
Apr 1, 2025

Conversation

saucepoint
Copy link
Collaborator

@saucepoint saucepoint commented Mar 28, 2025

Related Issue

CI busted because foundry stable has breaking changes related to tests

Description of changes

  • Added allow_internal_expect_revert = true to the toml (migration guide)

  • Moved testFail* functions to test_revert* + vm.expectRevert (migration guide)

  • also actions/cache@v2 in the lint CI was deprecated so bumped that version

@saucepoint saucepoint requested a review from a team as a code owner March 28, 2025 21:02
function test_revertTransferFromBalanceOverflow(address sender, address receiver, uint256 id, uint256 amount)
public
{
vm.assume(sender != receiver);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally prefer an if statement instead of assume because of fuzzing erroring sometimes for too many assumes

vm.prank(sender);
token.transfer(receiver, id, amount);
}

function testFailTransferBalanceOverflow(address sender, address receiver, uint256 id, uint256 amount) public {
function test_revertTransferBalanceOverflow(address sender, address receiver, uint256 id, uint256 amount) public {
vm.assume(sender != receiver);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@saucepoint saucepoint merged commit df421dd into main Apr 1, 2025
5 checks passed
@saucepoint saucepoint deleted the fix-ci branch April 1, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants