-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1be072
commit ef5c351
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.19; | ||
|
||
import {Test} from "forge-std/Test.sol"; | ||
import {Raffle} from "../../src/Raffle.sol"; | ||
import {DeployRaffle} from "../../script/DeployRaffle.s.sol"; | ||
import {HelperConfig} from "../../script/HelperConfig.s.sol"; | ||
|
||
contract RaffleTest is Test { | ||
Raffle public raffle; | ||
HelperConfig public helperConfig; | ||
|
||
// constructor values for Raffle | ||
uint256 entranceFee; | ||
uint256 interval; | ||
address vrfCoordinator; | ||
bytes32 gasLane; | ||
uint32 callbackGasLimit; | ||
uint256 subscriptionId; | ||
|
||
address public PLAYER = makeAddr("player"); | ||
uint256 public constant STARTING_PLAYER_BALANCE = 10 ether; | ||
|
||
function setUp() public { | ||
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; | ||
callbackGasLimit = config.callbackGasLimit; | ||
subscriptionId = config.subscriptionId; | ||
|
||
vm.deal(PLAYER, STARTING_PLAYER_BALANCE); | ||
} | ||
|
||
function testRaffleInitializesInOpenState() public view { | ||
assert(raffle.getRaffleState() == Raffle.RaffleState.OPEN); | ||
} | ||
} |