Closed 0xpantera closed 6 months ago
Ah! So we should add this modifier. Good shout, any chance you'd be interested in making the PR?
Sorry, just saw this. I'd be happy to make the PR if it hasn't already been made.
Ah, I think this test is still correct.
revert Raffle__UpkeepNotNeeded(
address(this).balance,
s_players.length,
uint256(s_raffleState)
);
address(this).balance
is referring to the balance of the contract, not the wallet.
The test
testPerformUpkeepRevertsIfCheckUpkeepIsFalse
which does not have theskipFork
modifier will fail if the wallet balance on Sepolia is not zero.If wallet balance on Sepolia is not zero test will fail because it will throw a different error than the expected one by
vm.expectRevert()
:Expected error:
VM::expectRevert(Raffle__UpkeepNotNeeded(0, 0, 0))
Actual error:
VM::expectRevert(Raffle__UpkeepNotNeeded(actual-wallet-balance, 0, 0))
Test fail reason:
[FAIL. Reason: Error != expected error: 0x584327aa00000000000000000000000000000000000000000000000004f3c18bfe17f90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 != ]