Removed RAID_WAIT because it was just getting in way of UX
Some checks are pending
CI / Foundry project (push) Waiting to run
Some checks are pending
CI / Foundry project (push) Waiting to run
This commit is contained in:
parent
c1e6494937
commit
203ebd3e97
@ -11,7 +11,6 @@ contract RaidGeld is ERC20, Ownable {
|
||||
|
||||
uint256 public constant BUY_IN_AMOUNT = 0.00005 ether;
|
||||
uint256 public constant INITIAL_GELD = 50 * MANTISSA;
|
||||
uint256 public constant RAID_WAIT = 15 seconds;
|
||||
|
||||
mapping(address => Player) private players;
|
||||
mapping(address => Army) private armies;
|
||||
@ -56,7 +55,6 @@ contract RaidGeld is ERC20, Ownable {
|
||||
|
||||
// Manual minting for itchy fingers
|
||||
function raid() external onlyPlayer {
|
||||
require(block.timestamp >= players[msg.sender].last_raided_at + RAID_WAIT, "Tried minting too soon");
|
||||
performRaid(msg.sender);
|
||||
}
|
||||
|
||||
|
||||
@ -151,8 +151,6 @@ contract raid_geldTest is Test {
|
||||
|
||||
uint256 balance = raid_geld.balanceOf(player1);
|
||||
|
||||
// Warp time a bit so first raid doesnt fail
|
||||
vm.warp(block.timestamp + raid_geld.RAID_WAIT());
|
||||
// Trigger raid funds minting
|
||||
raid_geld.raid();
|
||||
|
||||
@ -162,11 +160,7 @@ contract raid_geldTest is Test {
|
||||
uint256 last_raided_at = player.last_raided_at;
|
||||
assertLt(balance, newBalance);
|
||||
|
||||
// Expect fail if we raid again, we need to wait a bit
|
||||
vm.expectRevert();
|
||||
raid_geld.raid();
|
||||
|
||||
// After wait time passes raid should work again
|
||||
// After wait time passes raid should bring in profits again
|
||||
vm.warp(block.timestamp + raid_geld.RAID_WAIT());
|
||||
raid_geld.raid();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user