File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -139,4 +139,8 @@ contract Raffle is VRFConsumerBaseV2Plus {
139
139
function getEntranceFee () external view returns (uint256 ) {
140
140
return i_entranceFee;
141
141
}
142
+
143
+ function getRaffleState () external view returns (RaffleState) {
144
+ return s_raffleState;
145
+ }
142
146
}
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^ 0.8.28 ;
3
+
4
+ import {Test} from "forge-std/Test.sol " ;
5
+ import {DeployRaffle} from "../../script/DeployRaffle.s.sol " ;
6
+ import {HelperConfig} from "../../script/HelperConfig.s.sol " ;
7
+ import {Raffle} from "../../src/Raffle.sol " ;
8
+
9
+ contract RaffleTest is Test {
10
+ Raffle public raffle;
11
+ HelperConfig public helperConfig;
12
+
13
+ uint256 entranceFee;
14
+ uint256 interval;
15
+ address vrfCoordinator;
16
+ bytes32 gasLane;
17
+ uint256 subscriptionId;
18
+ uint32 callbackGasLimit;
19
+
20
+ address public PLAYER = makeAddr ("player " );
21
+ uint256 public constant STARTING_PLAYER_BALANCE = 10 ether ;
22
+
23
+ function setUp () external {
24
+ DeployRaffle deployer = new DeployRaffle ();
25
+ (raffle, helperConfig) = deployer.deployContract ();
26
+
27
+ HelperConfig.NetworkConfig memory config = helperConfig.getConfig ();
28
+ entranceFee = config.entranceFee;
29
+ interval = config.interval;
30
+ vrfCoordinator = config.vrfCoordinator;
31
+ gasLane = config.gasLane;
32
+ subscriptionId = config.subscriptionId;
33
+ callbackGasLimit = config.callbackGasLimit;
34
+ }
35
+
36
+ function testRaffleInitializesInOpesState () public view {
37
+ assert (raffle.getRaffleState () == Raffle.RaffleState.OPEN);
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments