You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'm currenty in section 4 trying to write my test for testing if my entryRaffle contract gives the right revert message and if it actually starts in an open state.
code : function setUp() external {
DeployRaffle deployer = new DeployRaffle();
(raffle, helperConfig) = deployer.deployContract();
HelperConfig.NetworkConfig memory config = helperConfig.getConfig();
entranceFee = config.entranceFee;
interval = config.interval;
vrfCoordinator = config.vrfCoordinator;
gasLane = config.gasLane;
subscriptionId = config.subscriptionId;
callbackGasLimit = config.callbackGasLimit;
}
//Test that rafle begins in open state
function testRaffleinitAsOpen() public view {
assert(raffle.getRaffleState() == Raffle.RaffleState.OPEN);
}
//Testing actuall revert
function testRaffleRevertsWhenNotEnough() public {
vm.prank(PLAYER);
vm.expectRevert(Raffle.Raffle__NotEnoughToEnterRaflle.selector);
raffle.entryRaffle();
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
i'm currenty in section 4 trying to write my test for testing if my entryRaffle contract gives the right revert message and if it actually starts in an open state.
code : function setUp() external {
DeployRaffle deployer = new DeployRaffle();
(raffle, helperConfig) = deployer.deployContract();
Beta Was this translation helpful? Give feedback.
All reactions