Unit Test Partial

This commit is contained in:
2024-08-12 06:30:27 +08:00
parent 5df036c2c1
commit fdec58e8b8
6 changed files with 221 additions and 71 deletions
+11 -1
View File
@@ -72,7 +72,9 @@ contract Raffle is VRFConsumerBaseV2Plus, AutomationCompatibleInterface {
function enterRaffle() public payable {
// require(msg.value > i_entranceFee, "ETH too less!");
if (msg.value < i_entranceFee) {
uint256 msgValue = msg.value;
if (msgValue < i_entranceFee) {
revert Raffle__NotEnoughETHEntered();
}
if (s_raffleState != RaffleState.OPEN) {
@@ -240,4 +242,12 @@ contract Raffle is VRFConsumerBaseV2Plus, AutomationCompatibleInterface {
function getRecentWinner() public view returns (address) {
return s_recentWinner;
}
function getRaffleState() public view returns (RaffleState) {
return s_raffleState;
}
function getInterval() public view returns (uint256) {
return i_interval;
}
}