From 9f6d94c8f79ccd8a556db6684286dd0d7a5204e4 Mon Sep 17 00:00:00 2001 From: Mitja Belak Date: Thu, 31 Oct 2024 13:50:35 +0100 Subject: [PATCH] Added test for last boss uniqueness --- src/RaidGeld.sol | 5 ++--- test/RaidGeldUtils.t.sol | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/RaidGeld.sol b/src/RaidGeld.sol index 1da2f84..7afff11 100644 --- a/src/RaidGeld.sol +++ b/src/RaidGeld.sol @@ -28,7 +28,7 @@ contract RaidGeld is ERC20, Ownable, Constants { // Events event PlayerRegistered(address indexed player, uint256 initialGeld); - event PleyerStrikesAgain(address indexed player, uint256 totalRewards, uint256 initialGeld); + event PlayerStrikesAgain(address indexed player, uint256 totalRewards, uint256 initialGeld); event RaidPerformed(address indexed player, uint256 totalMinted, uint256 geldBalance); event UnitAdded( address indexed player, @@ -80,8 +80,7 @@ contract RaidGeld is ERC20, Ownable, Constants { players[player].n_runs += 1; if (existing_player) { - // TODO: Emit new run - emit PleyerStrikesAgain(player, players[player].total_rewards, INITIAL_GELD); + emit PlayerStrikesAgain(player, players[player].total_rewards, INITIAL_GELD); } else { // Emit event emit PlayerRegistered(msg.sender, INITIAL_GELD); diff --git a/test/RaidGeldUtils.t.sol b/test/RaidGeldUtils.t.sol index d5997e0..5bb42b3 100644 --- a/test/RaidGeldUtils.t.sol +++ b/test/RaidGeldUtils.t.sol @@ -148,4 +148,9 @@ contract raid_geldTest is Test { } console.log("Total", total); } + + function test_5_last_boss_is_unique(uint256 _randomSeed) public { + uint8[7] memory bosses = RaidGeldUtils.generate_boss_variants(_randomSeed); + vm.assertEq(bosses[6], 6); + } }