Skip to content

Commit

Permalink
chore: simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
fedealconada committed Jan 27, 2024
1 parent 3cb92a9 commit 2c1a6c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/Faucet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ contract Faucet is Initializable, UUPSUpgradeable, OwnableUpgradeable, IFaucet {
using SignatureChecker for address;

/* ============ Events ============ */

event Claim(address indexed _to, uint256 _timestamp);

/* ============ Constants ============ */

uint256 public constant CLAIM_AMOUNT = 1 ether / 2500;
uint256 public constant FAUCET_AMOUNT = 1 ether;

Expand Down
10 changes: 6 additions & 4 deletions test/Faucet.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ contract FaucetTest is SharedSetup {
vm.prank(_owner);
_faucet.startFaucet{value: 1 ether}();

for (uint256 i = 1; i <= 2500; i++) {
vm.prank(vm.addr(i));
_faucet.claimKintoETH();
}
// reduce faucet balance to CLAIM AMOUNT
vm.deal(address(_faucet), _faucet.CLAIM_AMOUNT());

vm.prank(_user);
_faucet.claimKintoETH();

// assert faucet is deactivated
assertEq(address(_faucet).balance, 0);
assertEq(_faucet.active(), false);
Expand Down

0 comments on commit 2c1a6c7

Please sign in to comment.